Documentation ¶
Index ¶
- type BoltStore
- func (e *BoltStore) DeleteKeys(prefix string) error
- func (e *BoltStore) Get(reader types.ReaderWriter, tree *types.Tree) error
- func (e *BoltStore) GetKey(key string) ([]byte, error)
- func (e *BoltStore) GetKeys(prefix string, separator string) ([]string, error)
- func (e *BoltStore) GetVersion(reader types.ReaderWriter, tree *types.Tree, version string) error
- func (e *BoltStore) GetVersions(reader types.ReaderWriter, tree *types.Tree) ([]string, error)
- func (e *BoltStore) Lock(key, s string) error
- func (e *BoltStore) Save(source types.ReaderWriter, tree *types.Tree) error
- func (e *BoltStore) SaveKey(key string, val []byte) error
- func (e *BoltStore) Setup() error
- func (e *BoltStore) Teardown() error
- func (e *BoltStore) Unlock(key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
BoltStore is an in-memory implementation of the Storage driver. Should not be used for anything other than testing.
func MakeBoltStore ¶
MakeBoltStore returns a new BoltStore for a given path.
func (*BoltStore) DeleteKeys ¶
DeleteKeys is actually DeleteBucket when in BoltDB It was just introduced for Consul designed tests.
func (*BoltStore) Get ¶
Get gets the latest version of a Key. Refer to GetVersion for more internal details.
func (*BoltStore) GetVersion ¶
GetVersion gets the specific version of a Key. Raises error if Key is absent.
func (*BoltStore) GetVersions ¶
GetVersions returns an array of all versions that are available for a given key.
func (*BoltStore) Lock ¶
Lock tries to lock a key with a given value. As of now value doesnt matter, existence of zero length value is assumed as Lock.
func (*BoltStore) Save ¶
Save is an Internal method to save Any data under a hierarchy that follows revision control. Example: In a workspace staging, you wish to save a new layout called dc1 saveRevision("staging", "layout", "dc1", {....}) will try to save the following structure workspace/layouts/dc1/latest workspace/layouts/dc1/new_timestamp NOTE: This is an atomic operation, so either everything is written or nothing is. The operation may take its own sweet time before a quorum write is guaranteed.
func (*BoltStore) Setup ¶
Setup creates a new Bucket if it doesn't exist already. Ideally it should be deleted after every test.