storage

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	// Get returns an io.ReadCloser for data at path, namespaced to the
	// model.
	//
	// If the data is still being uploaded and is not fully written yet, a
	// blobstore.ErrUploadPending error is returned. This means the path is
	// valid but the caller should try again later to retrieve the data.
	Get(path string) (r io.ReadCloser, length int64, err error)

	// Put stores data from reader at path, namespaced to the model.
	Put(path string, r io.Reader, length int64) error

	// PutAndCheckHash stores data from reader at path, namespaced to
	// the model. It also ensures the stored data has the correct
	// hash.
	PutAndCheckHash(path string, r io.Reader, length int64, hash string) error

	// Remove removes data at path, namespaced to the model.
	Remove(path string) error
}

Storage is an interface providing methods for storing and retrieving data by path.

func NewStorage

func NewStorage(modelUUID string, session *mgo.Session) Storage

NewStorage returns a Storage for the model with the specified UUID.

Jump to

Keyboard shortcuts

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