Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrExists is returned when an object exists ErrExists = errors.New("exists") // ErrNotFound is returned when an object is not found ErrNotFound = errors.New("not found") )
Functions ¶
Types ¶
type DB ¶
type DB interface { CreateTable(name string, obj Object) (Table, error) GetTable(name string, obj Object) (Table, error) GetTableVersion(string, ObjectVersion, func() hash.Hash) (TableVersion, error) }
DB implements a logical grouping of tables
type Datastore ¶
Datastore implements a store containing dbs
func NewBadgerDatastore ¶
NewBadgerDatastore returns a badger backed datastore
func NewBadgerDatastoreFromDB ¶
NewBadgerDatastoreFromDB returns a badger backed datastore
type ObjectVersion ¶
type ObjectVersion interface { // Previous should return the hash of the previous version of the // object. It should return nil if this is the first and only version PreviousDigest() digest.Digest Marshal() ([]byte, error) Unmarshal([]byte) error New() ObjectVersion Hash(h hash.Hash) }
ObjectVersion implements an interface for object versioning support
type Table ¶
type Table interface { Create(id []byte, obj Object) error Get(id []byte) (Object, error) Update(id []byte, obj Object) error Delete(id []byte) error Iter(start []byte, callback func(Object) error) error }
Table implements a collection of data structures of a given type
type TableVersion ¶
type TableVersion interface { // Returns the object hash and/or error Create(id []byte, obj ObjectVersion) ([]byte, error) // Returns the obj and object hash Get(id []byte) (ObjectVersion, []byte, error) // Returns the object hash and/or error Update(id []byte, obj ObjectVersion) ([]byte, error) // Deletes the object of the id and returns the object hash and/or error Delete(id []byte) ([]byte, error) // Iterate over the active Objects Iter([]byte, func(ObjectVersion) error) error // Iterate over each reference. IterRef([]byte, func(h []byte) error) error }
TableVersion implements a colloection of versioned data structures of a given type
Click to show internal directories.
Click to hide internal directories.