node-api/apps/drivers/types.go
Adam Štrauch 872826c0b1
All checks were successful
continuous-integration/drone/push Build is passing
Download link generator for snapshots
Three days expiration
2021-11-03 22:32:38 +01:00

26 lines
765 B
Go

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)
}