bitcask

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(l hclog.Logger) (db.KVStore, error)

New creates a new instance of the bitcask store.

Types

type BCStore

type BCStore struct {
	// contains filtered or unexported fields
}

BCStore is a store implementation based on the bitcask storage engine.

func (*BCStore) Capabilities

func (bcs *BCStore) Capabilities() []db.KVCapability

Capabilities returns that this key/value store supports te mutable property, allowing it to be writeable to the higher level systems.

func (*BCStore) Close

func (bcs *BCStore) Close() error

Close terminates the connection to the bitcask and flushes it to disk. The cask must not be used after Close() is called.

func (*BCStore) Del

func (bcs *BCStore) Del(_ context.Context, k string) error

Del removes any existing value at the location specified by the provided key.

func (*BCStore) Get

func (bcs *BCStore) Get(_ context.Context, k string) ([]byte, error)

Get returns the key at k or an error explaning why no data was returned.

func (*BCStore) Keys

func (bcs *BCStore) Keys(_ context.Context, f string) ([]string, error)

Keys is a way to enumerate the keys in the key/value store and to optionally filter them based on a globbing expression. This cheats and uses superior knowledge that NetAuth uses only a single key namespace with a single layer of keys below it. Its technically possible to do something dumb with an entity or group name that includes a path seperator, but this should be filtered out at a higher level.

func (*BCStore) Put

func (bcs *BCStore) Put(_ context.Context, k string, v []byte) error

Put stores the bytes of v at a location identitified by the key k. If the operation fails an error will be returned explaining why.

func (*BCStore) SetEventFunc

func (bcs *BCStore) SetEventFunc(f func(db.Event))

SetEventFunc sets up a function to call to fire events to subscribers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL