wrapper

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PORT is used by boltDB
	PORT = 0600
)

Variables

This section is empty.

Functions

func SetBoltDBPath

func SetBoltDBPath(path string) error

SetBoltDBPath set the path to save boltdb data.db file

Types

type BoltDB

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

BoltDB is a structure that contains a bucket name and a db instance

func (*BoltDB) Delete

func (db *BoltDB) Delete(key []byte) error

Delete deletes the value that matches key

func (*BoltDB) Get

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

Get returns data that matches the key.

func (BoltDB) List

func (db BoltDB) List() (map[string]interface{}, error)

List returns the list of values in map

func (*BoltDB) Put

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

Put updates the value that matches key

type Database

type Database interface {
	Get(key []byte) ([]byte, error)
	Put(key []byte, value []byte) error
	List() (map[string]interface{}, error)
	Delete(key []byte) error
}

Database is interface for boltDB

func NewBoltDB

func NewBoltDB(bucketname string) Database

NewBoltDB is return boltDB object

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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