boltdb

package
v0.0.0-...-8edd1ee Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBucket = "__default_bucket"
)

Variables

This section is empty.

Functions

func Close

func Close()

func Delete

func Delete(key string) error

func Exists

func Exists(key string) (bool, error)

func Get

func Get(key string) ([]byte, error)

func HDelete

func HDelete(name, key string) error

func HExists

func HExists(name, key string) (bool, error)

func HGet

func HGet(name, key string) ([]byte, error)

func HGetall

func HGetall(name string) ([][]byte, error)

func HKeys

func HKeys(name string) ([]string, error)

func HSet

func HSet(name, key string, data interface{}) error

func HVals

func HVals(name string) ([][]byte, error)

func Init

func Init(file string) error

初始化默认数据库,全局唯一的,用包名访问的方法,都存在此数据库中。

func Keys

func Keys(key string) ([]string, error)

func Set

func Set(key string, data interface{}) error

Types

type Boltdb

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

func GetDefaultDB

func GetDefaultDB() *Boltdb

获取默认数据库。

func NewBoltdb

func NewBoltdb(file string) (*Boltdb, error)

新打开一个数据库对象,如果程序中需要同时打开多个数据库,则可以用此方法。

func (*Boltdb) Close

func (b *Boltdb) Close()

关闭数据库

func (*Boltdb) Delete

func (b *Boltdb) Delete(key string) error

func (*Boltdb) Exists

func (b *Boltdb) Exists(key string) (bool, error)

func (*Boltdb) Get

func (b *Boltdb) Get(key string) ([]byte, error)

func (*Boltdb) HDelete

func (b *Boltdb) HDelete(name, key string) (err error)

func (*Boltdb) HExists

func (b *Boltdb) HExists(name, key string) (exists bool, err error)

func (*Boltdb) HGet

func (b *Boltdb) HGet(name, key string) (reply []byte, err error)

func (*Boltdb) HGetall

func (b *Boltdb) HGetall(name string) (keyAndValues [][]byte, err error)

func (*Boltdb) HKeys

func (b *Boltdb) HKeys(name string) (keys []string, err error)

func (*Boltdb) HSet

func (b *Boltdb) HSet(name, key string, data interface{}) (err error)

func (*Boltdb) HVals

func (b *Boltdb) HVals(name string) (vals [][]byte, err error)

func (*Boltdb) Keys

func (b *Boltdb) Keys(key string) (keys []string, err error)

func (*Boltdb) Set

func (b *Boltdb) Set(key string, data interface{}) error

Jump to

Keyboard shortcuts

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