storage

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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 GetResourceSize(key string) uint

func GetSnapshot

func GetSnapshot(key string) (io.ReadCloser, error)

func GetSnapshotSize added in v0.2.0

func GetSnapshotSize(key string) uint

func Hash

func Hash(x []byte) string

func Init

func Init(sType string, sParams string) error

func SaveResource added in v0.2.0

func SaveResource(key string, resource []byte) error

func SaveSnapshot

func SaveSnapshot(key string, snapshot []byte) error

Types

type Storage

type Storage interface {
	Init(string) error
	GetSnapshot(string) io.ReadCloser
	GetSnapshotSize(string) uint
	SaveSnapshot(string, []byte) error
	SaveResource(string, []byte) error
	GetResource(string) io.ReadCloser
	GetResourceSize(string) uint
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL