storage

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltBucket

type BoltBucket struct {
	*BoltStorage
	// contains filtered or unexported fields
}

func (*BoltBucket) All

func (bb *BoltBucket) All() (map[string][]byte, error)

All 获取指定 Bucket 中所有数据

func (*BoltBucket) BatchUpdate

func (bb *BoltBucket) BatchUpdate(key, value []byte) error

Update 数据, 当使用多线程/协程处理时,用此方法

func (*BoltBucket) Delete

func (bb *BoltBucket) Delete(key []byte) error

Delete 删除指定 KEY-VALUE 数据

func (*BoltBucket) Get

func (bb *BoltBucket) Get(key []byte) ([]byte, error)

Get 在指定 Bucket 中查询相关值

func (*BoltBucket) Set

func (bb *BoltBucket) Set(key, value []byte) error

Set 在指定 Bucket 中存储数据

type BoltStorage

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

func NewBolt

func NewBolt(dbPath string) (*BoltStorage, error)

func (*BoltStorage) All

func (b *BoltStorage) All() (map[string][]byte, error)

func (*BoltStorage) BatchUpdate

func (b *BoltStorage) BatchUpdate(key, value []byte) error

func (*BoltStorage) Close

func (b *BoltStorage) Close()

func (*BoltStorage) Delete

func (b *BoltStorage) Delete(key []byte) error

func (*BoltStorage) DeleteBucket

func (b *BoltStorage) DeleteBucket(name string) error

DeleteBucket 删除指定 Bucket

func (*BoltStorage) Get

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

func (*BoltStorage) NewBucket

func (b *BoltStorage) NewBucket(name string) (*BoltBucket, error)

NewBucket 创建一个新的 Bucket

func (*BoltStorage) Set

func (b *BoltStorage) Set(key, value []byte) error

func (*BoltStorage) Sync

func (b *BoltStorage) Sync() error

Sync 数据刷盘

Jump to

Keyboard shortcuts

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