storage manager: remove fog backend.

Remove in favor of rclone.
This commit is contained in:
evazion
2019-12-13 01:45:43 -06:00
parent 8e93b0fc6c
commit 92aca9ed2d
3 changed files with 0 additions and 45 deletions

View File

@@ -1,32 +0,0 @@
class StorageManager::Cloud < StorageManager
attr_reader :bucket, :client, :fog_options
def initialize(bucket, client: nil, fog_options: {}, **options)
@bucket = bucket
@fog_options = fog_options
@client = client || Fog::Storage.new(**fog_options)
super(**options)
end
def store(io, path)
io.rewind # XXX caller should be responsible for this.
data = io.read
client.put_object(bucket, key(path), data)
end
def delete(path)
client.delete_object(bucket, key(path))
end
def open(path)
file = Tempfile.new(binmode: true)
response = client.get_object(bucket, key(path))
file.write(response.body)
file.rewind
file
end
def key(path)
path.delete_prefix("/")
end
end