stringkey

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringKeyerDb

type StringKeyerDb struct {
	kv.OrderedTransactional
}

func New

New creates a new db where keys are strings and not bytes. Only a wrapper for []byte(key string)

func (*StringKeyerDb) Delete

func (bs *StringKeyerDb) Delete(ctx context.Context, key string) error

Delete removes a key within a single transaction

func (*StringKeyerDb) Get

func (bs *StringKeyerDb) Get(ctx context.Context, key string) (res []byte, err error)

Get gets the value of a key within a single query transaction

func (*StringKeyerDb) NewTransaction

func (bs *StringKeyerDb) NewTransaction(ctx context.Context, readOnly bool) (kv.OrderedTransaction, error)

NewTransaction for batching multiple values inside a transaction

func (*StringKeyerDb) Put

func (bs *StringKeyerDb) Put(ctx context.Context, key string, value []byte) error

Put sets the value of a key within a single query transaction

type StringKeyerDbIterator

type StringKeyerDbIterator struct {
	kv.Iterator
}

func (*StringKeyerDbIterator) Next

func (it *StringKeyerDbIterator) Next(ctx context.Context) (key string, value []byte, err error)

type StringKeyerDbTransaction

type StringKeyerDbTransaction struct {
	kv.OrderedTransaction
}

func (*StringKeyerDbTransaction) Delete

func (bs *StringKeyerDbTransaction) Delete(ctx context.Context, key string) error

Delete removes a key within a single transaction

func (*StringKeyerDbTransaction) Get

func (bs *StringKeyerDbTransaction) Get(ctx context.Context, key string) (res []byte, err error)

Get gets the value of a key within a single query transaction

func (*StringKeyerDbTransaction) Put

func (bs *StringKeyerDbTransaction) Put(ctx context.Context, key string, value []byte) error

Put sets the value of a key within a single query transaction

func (*StringKeyerDbTransaction) Seek

func (bst *StringKeyerDbTransaction) Seek(ctx context.Context, StartKey string) (kv.Iterator, error)

Jump to

Keyboard shortcuts

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