Documentation
¶
Overview ¶
package defines the general API for a content addressable k/v store and a default implementation using boltdb
Index ¶
Constants ¶
View Source
const (
DefaultDb = "boris.db"
)
api constants
View Source
const KeySize = sha1.Size
value blob keys are sha1 digests
Variables ¶
View Source
var ( ExistingErr = fmt.Errorf("existing entry") NotFoundErr = fmt.Errorf("entry not found") DataCorruptedErr = fmt.Errorf("data corrupted") DiskFullErr = fmt.Errorf("disk full error") NilValueErr = fmt.Errorf("nil value error") ZeroValueErr = fmt.Errorf("zero value error") InvalidKeyErr = fmt.Errorf("key is not compliant to spec.") )
Errors & Warnings
Functions ¶
This section is empty.
Types ¶
type KVStore ¶
type KVStore interface {
// Adds value blob 'val' to store. Returns computed key.
Put(val []byte) (Key, error)
// Gets the specified value for 'key', if any.
Get(key Key) ([]byte, error)
// Dels the specified value for 'key', if any.
Del(key Key) ([]byte, error)
}
type defines the interface for a content addressable k/v store.
Click to show internal directories.
Click to hide internal directories.