Documentation ¶
Overview ¶
Package storer implements an abstract key-value storage interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStorerExist = errors.New("storer: value already exists") ErrStorerNotExist = errors.New("storer: value does not exist") )
Errors which may be returned by a Storer.
Functions ¶
This section is empty.
Types ¶
type Storer ¶
type Storer interface { // Load a value. Returns the value and its length. If the value does not // exist, Load returns ErrStorerNotExist Load(key []byte) (value io.ReadCloser, length uint64, err error) // Store a value. If value is nil, Store only checks if the value could // be stored. If the value is already stored, Store returns // ErrStorerExist. Store(key []byte, length uint64, value io.Reader) error // Delete a value. If the value does not exist, Delete returns // ErrStorerNotExist. Delete(key []byte) error // Close the Storer. Close() error }
Storer stores key-value pairs. Storer is safe for concurrent use. Keys must be at least one byte in length.
Click to show internal directories.
Click to hide internal directories.