Documentation
¶
Overview ¶
Package facade provide interfaces for FDB APIs.
Index ¶
- func NewNilDirectory() directory.Directory
- func NewNilDirectorySubspace() directory.DirectorySubspace
- func NewNilExactRange() fdb.ExactRange
- func NewNilFuture() fdb.Future
- func NewNilFutureByteSlice() fdb.FutureByteSlice
- func NewNilFutureNil() fdb.FutureNil
- func NewNilKeyConvertible() fdb.KeyConvertible
- func NewNilRange() fdb.Range
- func NewNilSelectable() fdb.Selectable
- func NewNilSubspace() subspace.Subspace
- type ReadTransaction
- type ReadTransactor
- type Transaction
- type Transactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNilDirectory ¶
NewNilDirectory returns a nil implementation of directory.Directory where every operation is a no-op.
func NewNilDirectorySubspace ¶
func NewNilDirectorySubspace() directory.DirectorySubspace
NewNilDirectorySubspace returns a nil implementation of directory.DirectorySubspace where every operation is a no-op.
func NewNilExactRange ¶
func NewNilExactRange() fdb.ExactRange
NewNilExactRange returns a nil implementation of fdb.ExactRange where every operation is a no-op.
func NewNilFuture ¶
NewNilFuture returns a nil implementation of fdb.Future where every operation is a no-op.
func NewNilFutureByteSlice ¶
func NewNilFutureByteSlice() fdb.FutureByteSlice
NewNilFutureByteSlice returns a nil implementation of fdb.FutureByteSlice where every operation is a no-op.
func NewNilFutureNil ¶
NewNilFutureNil returns a nil implementation of fdb.FutureNil where every operation is a no-op.
func NewNilKeyConvertible ¶
func NewNilKeyConvertible() fdb.KeyConvertible
NewNilKeyConvertible returns a nil implementation of fdb.KeyConvertible where every operation is a no-op.
func NewNilRange ¶
NewNilRange returns a nil implementation of fdb.Range where every operation is a no-op.
func NewNilSelectable ¶
func NewNilSelectable() fdb.Selectable
NewNilSelectable returns a nil implementation of fdb.Selectable where every operation is a no-op.
func NewNilSubspace ¶
NewNilSubspace returns a nil implementation of subspace.Subspace where every operation is a no-op.
Types ¶
type ReadTransaction ¶
type ReadTransaction interface {
ReadTransactor
// Get requests the values bytes for the given key.
Get(key fdb.KeyConvertible) fdb.FutureByteSlice
// GetRange performs a range-read over the given range.
GetRange(r fdb.Range, options fdb.RangeOptions) fdb.RangeResult
}
ReadTransaction provides methods for reading key-values from an open transaction.
func NewNilReadTransaction ¶
func NewNilReadTransaction() ReadTransaction
NewNilReadTransaction returns a nil implementation of ReadTransaction where every operation is a no-op.
func NewReadTransaction ¶
func NewReadTransaction(tr fdb.ReadTransaction, root directory.Directory) ReadTransaction
NewReadTransaction creates a new instance of a ReadTransaction backed by a fdb.ReadTransaction. Any directory operations performed by the returned ReadTransaction will use the given directory.Directory as the root.
type ReadTransactor ¶
type ReadTransactor interface {
// ReadTransact opens a new transaction. If this ReadTransactor is backed by a
// transaction then that transaction is reused.
ReadTransact(func(ReadTransaction) (interface{}, error)) (interface{}, error)
// DirOpen opens a directory under the root directory specified by the
// implementation.
DirOpen(path []string) (directory.DirectorySubspace, error)
// DirList lists the directories under the root directory specified by
// the implementation.
DirList(path []string) ([]string, error)
}
ReadTransactor provides methods for performing read transactions and for opening & listing directories.
func NewNilReadTransactor ¶
func NewNilReadTransactor() ReadTransactor
NewNilReadTransactor returns a nil implementation of ReadTransactor where every operation is a no-op.
func NewReadTransactor ¶
func NewReadTransactor(tr fdb.ReadTransactor, root directory.Directory) ReadTransactor
NewReadTransactor creates a new instance of a ReadTransactor backed by a fdb.ReadTransactor. Any directory operations performed by the returned ReadTransactor will use the given directory.Directory as the root.
type Transaction ¶
type Transaction interface {
ReadTransaction
Transactor
// Set writes a key-value.
Set(fdb.KeyConvertible, []byte)
// Set writes a key-value. The key should contain
// the placeholder for a single versionstamp as
// described here:
// https://pkg.go.dev/github.com/apple/foundationdb/bindings/go/src/fdb#Transaction.SetVersionstampedKey
SetWithVStampKey(fdb.KeyConvertible, []byte)
// TOOD
SetWithVStampValue(fdb.KeyConvertible, []byte)
// Clear deletes a key-value.
Clear(fdb.KeyConvertible)
// Watch creates a watch and returns a FutureNil that will become ready when the
// watch reports a change to the value of the specified key.
Watch(fdb.KeyConvertible) fdb.FutureNil
}
Transaction provides methods for reading or writing key-values from an open transaction.
func NewNilTransaction ¶
func NewNilTransaction() Transaction
NewNilTransaction returns a nil implementation of Transaction where every operation is a no-op.
func NewTransaction ¶
func NewTransaction(tr fdb.Transaction, root directory.Directory) Transaction
NewTransaction creates a new instance of a Transaction backed by a fdb.Transaction. Any directory operations performed by the returned Transaction will use the given directory.Directory as the root.
type Transactor ¶
type Transactor interface {
ReadTransactor
// Transact opens a new transaction. If this Transactor is backed by a
// transaction then that transaction is reused.
Transact(func(Transaction) (interface{}, error)) (interface{}, error)
// DirCreateOrOpen opens a directory (or creates it if it doesn't exist)
// under the root directory specified by the implementation.
DirCreateOrOpen(path []string) (directory.DirectorySubspace, error)
}
Transactor provides methods for performing read or write transactions and for creating, opening, & listing directories.
func NewNilTransactor ¶
func NewNilTransactor() Transactor
NewNilTransactor returns a nil implementation of Transactor where every operation is a no-op.
func NewTransactor ¶
func NewTransactor(tr fdb.Transactor, root directory.Directory) Transactor
NewTransactor creates a new instance of a Transactor backed by a fdb.Transactor. Any directory operations performed by the returned Transactor will use the given directory.Directory as the root.