Documentation ¶
Index ¶
- func Decoder(data []byte, v interface{})
- func Encoder(data interface{}) []byte
- func Obj2Map(obj interface{}) map[string]interface{}
- type Item
- type Items
- type LeveldbStorage
- func (s *LeveldbStorage) AutoId() int64
- func (s *LeveldbStorage) BatchSet(kv *Items) ([]string, error)
- func (s *LeveldbStorage) Close() error
- func (s *LeveldbStorage) DB() *leveldb.DB
- func (s *LeveldbStorage) Delete(key []byte) error
- func (s *LeveldbStorage) Get(key []byte) ([]byte, bool)
- func (s *LeveldbStorage) GetAll(start int64, end int64, order string, filter func(Item) (bool, Item)) (int64, Items)
- func (s *LeveldbStorage) GetCount() int64
- func (s *LeveldbStorage) GetList(start int64, end int64, order string, filter func(Item) (bool, Item), ...) (int64, Items)
- func (s *LeveldbStorage) Has(key []byte) bool
- func (s *LeveldbStorage) NGet(key []byte, cache bool) ([]byte, bool)
- func (s *LeveldbStorage) NewItem(key []byte, value []byte) *Item
- func (s *LeveldbStorage) ReOpen() error
- func (s *LeveldbStorage) Search(callback func(Item) (v any), option *SearchOption) (int64, Items)
- func (s *LeveldbStorage) Set(key []byte, value []byte) error
- type SearchOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LeveldbStorage ¶
type LeveldbStorage struct { CacheEnable bool // contains filtered or unexported fields }
LeveldbStorage TODO 要支持事务
func NewStorage ¶
func NewStorage(path string, cache bool, timeout int64) (*LeveldbStorage, error)
NewStorage 打开数据库
func (*LeveldbStorage) AutoId ¶
func (s *LeveldbStorage) AutoId() int64
func (*LeveldbStorage) DB ¶
func (s *LeveldbStorage) DB() *leveldb.DB
func (*LeveldbStorage) GetCount ¶
func (s *LeveldbStorage) GetCount() int64
func (*LeveldbStorage) Has ¶
func (s *LeveldbStorage) Has(key []byte) bool
func (*LeveldbStorage) ReOpen ¶
func (s *LeveldbStorage) ReOpen() error
func (*LeveldbStorage) Search ¶
func (s *LeveldbStorage) Search(callback func(Item) (v any), option *SearchOption) (int64, Items)
callbacl传入要转换的对你
Click to show internal directories.
Click to hide internal directories.