node-api/apps/drivers/types.go

26 lines
765 B
Go
Raw Normal View History

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
// GetDownloadLink returns URL of object with given key. That URL can be used to download the object.
GetDownloadLink(key string) (string, error)
}