xbolts

package
v0.0.0-...-89edfd8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close bolt db

func Delete

func Delete(bucket []byte, key []byte) error

Delete a key from target bucket

func Get

func Get(bucket []byte, key []byte) []byte

Get value from bucket by key

func GetAllKeys

func GetAllKeys(bucket []byte) [][]byte

GetAllKeys get all keys from the target bucket

func InitBolt

func InitBolt(path string, buckets []string) error

InitBolt inits bolt database. Create the file if not exist. By default it opens the file in 0600 mode, with a 10 seconds timeout period

func Put

func Put(bucket []byte, key []byte, value []byte) error

Put a key/value pair into target bucket

Types

type BoltPair

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

BoltPair is a struct to store key/value pair data

func GetAllKeyValues

func GetAllKeyValues(bucket []byte) []BoltPair

GetAllKeyValues get all key/value pairs from a bucket in BoltPair struct format

Jump to

Keyboard shortcuts

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