Documentation
¶
Index ¶
- Constants
- Variables
- func InitBoltDBClient(clientName string, dbPath string) error
- type BoltDB
- func (b *BoltDB) ClearBucket(bucketName string) error
- func (b *BoltDB) Close() error
- func (b *BoltDB) Count(bucketName string) (int, error)
- func (b *BoltDB) CreateBucket(bucketName string) error
- func (b *BoltDB) CreateBucketIfNotExists(bucketName string) error
- func (b *BoltDB) Delete(bucketName string, key string) error
- func (b *BoltDB) DeleteBucket(bucketName string) error
- func (b *BoltDB) Exists(bucketName string, key string) (bool, error)
- func (b *BoltDB) ForEach(bucketName string, fn func(string, []byte) error) error
- func (b *BoltDB) Get(bucketName string, key string) ([]byte, error)
- func (b *BoltDB) GetAll(bucketName string) (map[string][]byte, error)
- func (b *BoltDB) Put(bucketName string, key string, value []byte) error
Constants ¶
View Source
const DefaultBoltDBClientName = "default"
Variables ¶
View Source
var BoltDBClients = make(map[string]*BoltDB)
Functions ¶
func InitBoltDBClient ¶
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
BoltDB 封装了bbolt数据库连接和操作
func GetBoltDBClient ¶
func (*BoltDB) ClearBucket ¶
ClearBucket 清空指定bucket中的所有数据
func (*BoltDB) CreateBucket ¶
CreateBucket 创建一个新的bucket
func (*BoltDB) CreateBucketIfNotExists ¶
CreateBucketIfNotExists 如果bucket不存在则创建
func (*BoltDB) DeleteBucket ¶
DeleteBucket 删除一个bucket
Click to show internal directories.
Click to hide internal directories.