badgerdb

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB holds a pointer to the badger database and the path to where it is stored.

func NewDB

func NewDB(path string) (s *DB, err error)

NewDB is a constructor for the badger persister It creates the files in the location given as parameter

func (*DB) Close

func (s *DB) Close() error

Close closes the files/resources associated to the storage medium

func (*DB) Destroy

func (s *DB) Destroy() error

Destroy removes the storage medium stored data

func (*DB) Get

func (s *DB) Get(key []byte) ([]byte, error)

Get returns the value associated to the key

func (*DB) Has

func (s *DB) Has(key []byte) error

Has returns true if the given key is present in the persistance medium

func (*DB) Init

func (s *DB) Init() error

Init initializes the storage medium and prepares it for usage

func (*DB) Put

func (s *DB) Put(key, val []byte) error

Put adds the value to the (key, val) storage medium

func (*DB) Remove

func (s *DB) Remove(key []byte) error

Remove removes the data associated to the given key

Jump to

Keyboard shortcuts

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