Documentation ¶
Overview ¶
Package storage defines a persistent storage interface.
Index ¶
- Variables
- type BlobStore
- func (s BlobStore) Delete(ctx context.Context, key string) error
- func (s BlobStore) Load(ctx context.Context, key string, val proto.Message) error
- func (s BlobStore) Scan(ctx context.Context, start string, f func(string) error) error
- func (s BlobStore) Store(ctx context.Context, key string, val proto.Message) error
- type Interface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyNotFound is returned by Load when the specified key is not found. ErrKeyNotFound = errors.New("key not found") // ErrStopScan is returned by the callback to Scan to terminate a scan. ErrStopScan = errors.New("stop scanning") )
Functions ¶
This section is empty.
Types ¶
type BlobStore ¶
type BlobStore struct {
// contains filtered or unexported fields
}
BlobStore implements the package Storage interfaces.
type Interface ¶
type Interface interface { // Load reads the data for the specified key and unmarshals it into val. // If key is not present, Load must return storage.ErrKeyNotFound. Load(ctx context.Context, key string, val proto.Message) error // Store marshals the data from value and stores it under key. Store(ctx context.Context, key string, val proto.Message) error // Scan calls f with each key lexicographically greater than or equal to // start. If f reports an error scanning stops; if the error is ErrStopScan // then Scan return nil, otherwise Scan returns the error from f. Scan(ctx context.Context, start string, f func(string) error) error // Delete removes the specified key from the database. Delete(ctx context.Context, key string) error }
Interface represents the interface to persistent storage.
Click to show internal directories.
Click to hide internal directories.