2021-10-02 18:00:35 +00:00
|
|
|
package drivers
|
|
|
|
|
|
|
|
// DriverInterface defined methods every storage driver needs to implement
|
|
|
|
type DriverInterface interface {
|
|
|
|
// Create creates a new object in the storage from given file name
|
|
|
|
Create(key string, filePath string) error
|
|
|
|
|
|
|
|
// Write writes content of body into key
|
|
|
|
Write(key string, body []byte) error
|
|
|
|
|
|
|
|
// Get returns content of given key
|
|
|
|
Get(key string, filePath string) error
|
|
|
|
|
|
|
|
// Read returns content of given key
|
|
|
|
Read(key string) ([]byte, error)
|
|
|
|
|
|
|
|
// List returns list of objects in fiven prefix
|
|
|
|
List(prefix string) ([]string, error)
|
|
|
|
|
|
|
|
// Delete deletes one object
|
|
|
|
Delete(key string) error
|
2021-11-03 21:32:38 +00:00
|
|
|
|
|
|
|
// GetDownloadLink returns URL of object with given key. That URL can be used to download the object.
|
|
|
|
GetDownloadLink(key string) (string, error)
|
2021-10-02 18:00:35 +00:00
|
|
|
}
|