Documentation ¶
Index ¶
- type DB
- func (db *DB) Delete(key Key)
- func (db *DB) DeleteAll()
- func (db *DB) DeleteS(key string)
- func (db *DB) ForS(prefix string, page, size int, filter func(string) bool, it interface{}) (total int)
- func (db *DB) Get(key Key, v interface{}) (noExist bool)
- func (db *DB) GetRaw(key Key) []byte
- func (db *DB) GetS(key string, v interface{}) (noExist bool)
- func (db *DB) GetSRaw(key string) []byte
- func (db *DB) New() Key
- func (db *DB) Set(key Key, v interface{})
- func (db *DB) SetRaw(key Key, raw []byte)
- func (db *DB) SetS(key string, v interface{})
- func (db *DB) SetSRaw(key string, raw []byte)
- func (db *DB) Unknown(key Key) bool
- func (db *DB) UnknownS(key string) bool
- type Key
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a data base
func (*DB) ForS ¶
func (db *DB) ForS(prefix string, page, size int, filter func(string) bool, it interface{}) (total int)
Make an iteration on all the element in the DB that begins with prefix.
Page is the index of the page of length size. If zero, web take all keys.
We can select some elements with them key, so we use filter. filter can be nil.
It must be a function that take a string and a other type for the value, else it panic.
MyDB.For(func(k db.Key, v MyType){...})
total is the number of elements in the DB with prefix and that pass filter.
Click to show internal directories.
Click to hide internal directories.