jsondb

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...JsonDBOpts) (storage.Connection, error)

Types

type JsonDB

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

func (*JsonDB) Bucket

func (j *JsonDB) Bucket(bucket ...string) *storage.Bucket

func (*JsonDB) Close

func (j *JsonDB) Close()

func (*JsonDB) Delete

func (j *JsonDB) Delete(k string) error

func (*JsonDB) Encoding

func (j *JsonDB) Encoding() encoding.Coder

func (*JsonDB) Exists

func (j *JsonDB) Exists(k string) bool

func (*JsonDB) Get

func (j *JsonDB) Get(k string, v any) error

func (*JsonDB) Iter

func (j *JsonDB) Iter(ctx context.Context, pfx string) types.Iterator[string, []byte]

func (*JsonDB) Keys

func (j *JsonDB) Keys(pfx string) ([]string, error)

func (*JsonDB) Len

func (j *JsonDB) Len(pfx string) (int, error)

func (*JsonDB) PrintDebug

func (j *JsonDB) PrintDebug(pfx string) error

func (*JsonDB) Save

func (j *JsonDB) Save() error

func (*JsonDB) Set

func (j *JsonDB) Set(k string, v any, op ...storage.Option) error

func (*JsonDB) Tx

func (j *JsonDB) Tx(pfx string, fn func(tx storage.Transactioner) error) error

func (*JsonDB) Values

func (j *JsonDB) Values(pfx string) ([][]byte, error)

func (*JsonDB) Watch

func (j *JsonDB) Watch(ctx context.Context, pfx string) types.Watcher[string, []byte]

type JsonDBOpts added in v0.1.1

type JsonDBOpts func(*JsonDB) error

func Dir added in v0.1.1

func Dir(dir string) JsonDBOpts

func File added in v0.1.1

func File(path string) JsonDBOpts

func Logger added in v0.1.1

func Logger(lg storage.Logger) JsonDBOpts

Jump to

Keyboard shortcuts

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