Documentation ¶
Index ¶
- type DB
- func (dbase *DB) Del(key string) error
- func (dbase *DB) Expire(key string, ttl time.Duration) error
- func (dbase *DB) Get(key string) (string, error)
- func (dbase *DB) GetBytes(key string) ([]byte, error)
- func (dbase *DB) Range() ([]*KV, error)
- func (dbase *DB) Set(key, val string, ttl time.Duration) error
- func (dbase *DB) SetBytes(key string, val []byte, ttl time.Duration) error
- func (dbase *DB) TTL(key string) (time.Duration, error)
- type DBType
- func (dbase *DBType) Backup(backupDbFilePath string) error
- func (dbase *DBType) Close()
- func (dbase *DBType) DeleteBucket(bucketName string) error
- func (dbase *DBType) DeleteByKeys(keys []string) error
- func (dbase *DBType) DeleteByKeysTransaction(keys []string) error
- func (dbase *DBType) GetAll() (map[string][]byte, error)
- func (dbase *DBType) GetByKey(key string) ([]byte, error)
- func (dbase *DBType) GetByKeys(keys []string) (map[string][]byte, error)
- func (dbase *DBType) Set(kv map[string][]byte) error
- type KV
- type KVInterface
- type KeyValueStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBType ¶
type DBType struct {
// contains filtered or unexported fields
}
DBType BlotDB的管理类
func (*DBType) DeleteBucket ¶
DeleteBucket 删除Bucket
func (*DBType) DeleteByKeys ¶
DeleteByKeys 删除键值
func (*DBType) DeleteByKeysTransaction ¶
DeleteByKeysTransaction 在事务中,删除键值
type KVInterface ¶
type KVInterface interface { // Set 设置值 kv 键值对 Set(kv map[string][]byte) error // GetByKey 根据键名获取各自的值, key 键名 GetByKey(key string) ([]byte, error) // GetByKeys 根据键名数组获取各自的值, keys 键名数组 GetByKeys(keys []string) (map[string][]byte, error) // GetAll 获取全部 GetAll() (map[string][]byte, error) // DeleteByKeys 删除键值 DeleteByKeys(keys []string) error // DeleteByKeysTransaction 在事务中,删除键值 DeleteByKeysTransaction(keys []string) error // DeleteBucket 移除Bucket DeleteBucket(bucketName string) (err error) // Backup 备份数据库文件 Backup(backupDbFilePath string) error // Close 关库数据库 Close() }
type KeyValueStore ¶
type KeyValueStore interface { GetBytes(key string) ([]byte, error) Get(key string) (string, error) SetBytes(key string, val []byte, ttl time.Duration) error Set(key, val string, ttl time.Duration) error TTL(key string) (time.Duration, error) Expire(key string, ttl time.Duration) error Del(key string) error Range() ([]*KV, error) }
func NewDB ¶
func NewDB(filepath string) KeyValueStore
Click to show internal directories.
Click to hide internal directories.