jsondb

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
	ErrJSON     = errors.New("json error")
	ErrSync     = errors.New("sync error")
)

Functions

This section is empty.

Types

type DB

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

func Open

func Open(path string, opts ...Option) (*DB, error)

func (*DB) Delete

func (db *DB) Delete(key string) error

func (*DB) Get

func (db *DB) Get(key string, val interface{}) error

func (*DB) GetRaw

func (db *DB) GetRaw(key string) (json.RawMessage, error)

func (*DB) Iter

func (db *DB) Iter(fn func(key string, value json.RawMessage) error)

func (*DB) Save

func (db *DB) Save() error

func (*DB) Set

func (db *DB) Set(key string, val any) error

func (*DB) SetRaw

func (db *DB) SetRaw(key string, val json.RawMessage) error

type Option

type Option int64
const (
	OptSync Option = iota
)

Jump to

Keyboard shortcuts

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