datastore

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStore

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

KVStore is the key value datastore

func NewKVStore

func NewKVStore(path string, options *KVStoreOptions) (*KVStore, error)

NewKVStore creates a new key value datastore

func (*KVStore) GarbageCollect added in v0.3.0

func (s *KVStore) GarbageCollect() error

GarbageCollect cleans up old values in log files

func (*KVStore) Get

Get retrieves key values from the datastore.

func (*KVStore) Set

func (s *KVStore) Set(request *apiv1.SetValuesRequest) error

Set sets key values in the datastore.

func (*KVStore) Subscribe

func (s *KVStore) Subscribe(ctx context.Context, subscription *apiv1.SubscribeRequest, cb func(*apiv1.SubscribeResponse) error) error

Subscribe will subscribe to prefixes in the key value store. This will block until there is an error or the context is cancelled

type KVStoreOptions added in v0.6.0

type KVStoreOptions struct {
	EnableTruncate                              *wrappers.BoolValue
	MaxTableSize                                *wrappers.Int64Value
	LevelOneSize                                *wrappers.Int64Value
	LevelSizeMultiplier                         *wrappers.Int32Value
	NumberOfLevelZeroTables                     *wrappers.Int32Value
	NumberOfLevelZeroTablesUntilForceCompaction *wrappers.Int32Value
	GarbageCollectionDiscardRatio               *wrappers.FloatValue
	InMemory                                    *wrappers.BoolValue
}

KVStoreOptions represent environment variable configurable options related to the KV Store.

Jump to

Keyboard shortcuts

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