Documentation
¶
Index ¶
- Variables
- func FS() iofs.FS
- func GetResource(key string) (io.ReadCloser, error)
- func GetResourceSize(key string) uint
- func GetResourceURL(key string) (string, bool)
- func GetSnapshot(key string) (io.ReadCloser, error)
- func GetSnapshotSize(key string) uint
- func Hash(x []byte) string
- func Init(sCfg config.Storage) error
- func SaveResource(key string, resource []byte) error
- func SaveSnapshot(key string, snapshot []byte) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResourceNotFound = errors.New("resource not found")
View Source
var ErrSnapshotNotFound = errors.New("snapshot not found")
View Source
var ErrUninitialized = errors.New("uninitialized storage")
View Source
var ErrUnknownStorage = errors.New("unknown storage type")
Functions ¶
func GetResource ¶ added in v0.2.0
func GetResource(key string) (io.ReadCloser, error)
func GetResourceSize ¶ added in v0.2.0
func GetResourceURL ¶ added in v0.3.0
func GetSnapshot ¶
func GetSnapshot(key string) (io.ReadCloser, error)
func GetSnapshotSize ¶ added in v0.2.0
func SaveResource ¶ added in v0.2.0
func SaveSnapshot ¶
Types ¶
type Storage ¶
type Storage interface {
FS() (iofs.FS, error)
GetSnapshot(string) io.ReadCloser
GetSnapshotSize(string) uint
SaveSnapshot(string, []byte) error
SaveResource(string, []byte) error
GetResource(string) io.ReadCloser
GetResourceSize(string) uint
// return values: URL, isFullURL (true/false)
GetResourceURL(string) (string, bool)
}
Click to show internal directories.
Click to hide internal directories.