Documentation ¶
Overview ¶
Package kvs provides functionalities needed for storing key-value pairs on Swarm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNothingToSave indicates that no new key-value pair was added to the store. ErrNothingToSave = errors.New("nothing to save") // ErrNotFound is returned when an Entry is not found in the storage. ErrNotFound = errors.New("kvs entry not found") )
Functions ¶
This section is empty.
Types ¶
type KeyValueStore ¶
type KeyValueStore interface { // Get retrieves the value associated with the given key. Get(ctx context.Context, key []byte) ([]byte, error) // Put stores the given key-value pair in the store. Put(ctx context.Context, key, value []byte) error // Save saves key-value pair to the underlying storage and returns the reference. Save(ctx context.Context) (swarm.Address, error) }
KeyValueStore represents a key-value store.
func New ¶
func New(ls file.LoadSaver) (KeyValueStore, error)
New creates a new key-value store with a simple manifest.
func NewReference ¶
NewReference loads a key-value store with a simple manifest.
Click to show internal directories.
Click to hide internal directories.