Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Iterator ¶
Iterator iterates over a set of composite keys. It must only be used by one goroutine at a time. Consumers should not attempt to use an iterator once its parent transaction has been rolled back. Behavior is undefined in this case. The transaction must not mutate the store when the iterator is in use. This may cause inconsistent behavior.
type Map ¶
type Map interface { MapReader MapUpdater }
Map combines CompositeMapReader and CompositeMapUpdater
type MapReader ¶
type MapReader interface { Get(key composite.Key) ([]byte, error) Keys(keys composite.Range, order kv.SortOrder) (Iterator, error) }
MapReader is an interface for reading a sorted key-value map whose keys consist of a sequence of byte slices
func NamespaceMapReader ¶
NamespaceMapReader returns a namespaced map reader
type MapUpdater ¶
type MapUpdater interface { Put(key composite.Key, value []byte) error Delete(key composite.Key) error }
MapUpdater is an interface for updating a sorted key-value map whose keys consist of a sequence of byte slices
func NamespaceMapUpdater ¶
func NamespaceMapUpdater(mu MapUpdater, ns [][]byte) MapUpdater
NamespaceMapUpdater returns a namespaced map updater
type Partition ¶
type Partition interface { Name() []byte Create(metadata []byte) error Delete() error Begin(writable bool) (Transaction, error) snapshot.Source snapshot.Acceptor }
Partition is like kv.Partition except Begin returns composite.Transaction instead of kv.Transaction
func NewPartition ¶
NewPartition returns an instance of composite.Partition built on top of a kv.Partition
type Transaction ¶
type Transaction interface { Map // Metadata returns the metadata for this partition Metadata() ([]byte, error) // SetMetadata sets the metadata for this partition SetMetadata(metadata []byte) error // Commit commits the transaction Commit() error // Rollback rolls back the transaction Rollback() error }
Transaction is a transaction for a partition. It must only be used by one goroutine at a time.
func Namespace ¶
func Namespace(txn Transaction, ns [][]byte) Transaction
Namespace ensures that all keys referenced within a transaction are prefixed with ns.