Documentation ¶
Overview ¶
Implements a map-based store substitute that implements the legacy store API.
Index ¶
- Variables
- type Memstore
- func (ms *Memstore) Abort(_ interface{}) error
- func (ms *Memstore) BindObject(path string) *boundObject
- func (ms *Memstore) BindTransaction(_ string) Transaction
- func (ms *Memstore) BindTransactionRoot(_ string) Transaction
- func (ms *Memstore) Commit(_ interface{}) error
- func (ms *Memstore) CreateTransaction(_ interface{}) (string, error)
- func (ms *Memstore) Lock()
- func (ms *Memstore) Unlock()
- type MemstoreObject
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoRecursiveCreateTransaction = verror.Register(pkgPath+".ErrNoRecursiveCreateTransaction", verror.NoRetry, "{1:}{2:} recursive CreateTransaction() not permitted{:_}") ErrDoubleCommit = verror.Register(pkgPath+".ErrDoubleCommit", verror.NoRetry, "{1:}{2:} illegal attempt to commit previously committed or abandonned transaction{:_}") ErrAbortWithoutTransaction = verror.Register(pkgPath+".ErrAbortWithoutTransaction", verror.NoRetry, "{1:}{2:} illegal attempt to abort non-existent transaction{:_}") ErrWithoutTransaction = verror.Register(pkgPath+".ErrRemoveWithoutTransaction", verror.NoRetry, "{1:}{2:} call without a transaction{:_}") ErrNotInMemStore = verror.Register(pkgPath+".ErrNotInMemStore", verror.NoRetry, "{1:}{2:} not in Memstore{:_}") ErrUnsupportedType = verror.Register(pkgPath+".ErrUnsupportedType", verror.NoRetry, "{1:}{2:} attempted Put to Memstore of unsupported type{:_}") ErrChildrenWithoutLock = verror.Register(pkgPath+".ErrChildrenWithoutLock", verror.NoRetry, "{1:}{2:} Children() without a lock{:_}") )
Errors
Functions ¶
This section is empty.
Types ¶
type Memstore ¶
Memstore contains the state of the memstore. It supports a single transaction at a time. The current state of a Memstore under a transactional name binding is the contents of puts then the contents of (data - removes). puts and removes will be empty at the beginning of a transaction and after an Unlock operation.
func NewMemstore ¶
NewMemstore persists the Memstore to os.TempDir() if no file is configured.
func (*Memstore) BindObject ¶
BindObject sets the path string for subsequent operations.
func (*Memstore) BindTransaction ¶
func (ms *Memstore) BindTransaction(_ string) Transaction
BindTransaction on a Memstore can only use the single Memstore transaction.
func (*Memstore) BindTransactionRoot ¶
func (ms *Memstore) BindTransactionRoot(_ string) Transaction
BindTransactionRoot on a Memstore always operates over the entire Memstore. As a result, the root parameter is ignored.
func (*Memstore) CreateTransaction ¶
CreateTransaction requires the caller to acquire a lock on the Memstore.