basedb

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDb

type IDb interface {
	Set(prefix []byte, key []byte, value []byte) error
	Get(prefix []byte, key []byte) (Obj, bool, error)
	GetAllByCollection(prefix []byte) ([]Obj, error)
	CountByCollection(prefix []byte) (int64, error)
	RemoveAllByCollection(prefix []byte) error
	Close()
}

IDb interface for all db kind

type Obj

type Obj struct {
	Key   []byte
	Value []byte
}

Obj struct for getting key/value from storage

type Options

type Options struct {
	Type   string `yaml:"Type" env:"DB_TYPE" env-default:"badger-db" env-description:"Type of db badger-db or badger-memory"`
	Path   string `yaml:"Path" env:"DB_PATH" env-default:"./data/db" env-description:"Path for storage"`
	Logger *zap.Logger
}

Options for creating all db type

Jump to

Keyboard shortcuts

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