db

package
v0.9.200 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPEN_RO_PERMS = 0o600
	OPEN_RW_PERMS = 0o400
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Getters
	Get([][]byte, []byte) ([]byte, error)
	GetString([][]byte, []byte) (string, error)
	GetBool([][]byte, []byte) (bool, error)
	GetInt([][]byte, []byte) (int, error)

	// Setters (create or update)
	Put([][]byte, []byte, []byte) error
	PutString([][]byte, []byte, string) error
	PutBool([][]byte, []byte, bool) error
	PutInt([][]byte, []byte, int) error

	// Listers
	List([][]byte) ([][]byte, error)
	ListKeys([][]byte) ([][]byte, error)
}

Opening/creation of files/buckets must be managed by implementation [][]byte is used to represent a path to a bucket (for nested buckets)

func NewLocalDB

func NewLocalDB(path string) DB

type LocalDB

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

func (*LocalDB) Get

func (db *LocalDB) Get(path [][]byte, key []byte) ([]byte, error)

func (*LocalDB) GetAny

func (db *LocalDB) GetAny(path [][]byte, key []byte) (any, error)

func (*LocalDB) GetBool

func (db *LocalDB) GetBool(path [][]byte, key []byte) (bool, error)

func (*LocalDB) GetInt

func (db *LocalDB) GetInt(path [][]byte, key []byte) (int, error)

func (*LocalDB) GetString

func (db *LocalDB) GetString(path [][]byte, key []byte) (string, error)

func (*LocalDB) List

func (db *LocalDB) List(path [][]byte) ([][]byte, error)

func (*LocalDB) ListKeys

func (db *LocalDB) ListKeys(path [][]byte) ([][]byte, error)

func (*LocalDB) Put

func (db *LocalDB) Put(path [][]byte, key []byte, value []byte) error

func (*LocalDB) PutBool

func (db *LocalDB) PutBool(path [][]byte, key []byte, value bool) error

func (*LocalDB) PutInt

func (db *LocalDB) PutInt(path [][]byte, key []byte, value int) error

func (*LocalDB) PutString

func (db *LocalDB) PutString(path [][]byte, key []byte, value string) error

Jump to

Keyboard shortcuts

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