Documentation ¶
Index ¶
- Variables
- type Item
- type MemDB
- func (mdb *MemDB) AddIndex(name string)
- func (mdb *MemDB) CleanUp()
- func (mdb *MemDB) Create(item Item) int64
- func (mdb *MemDB) Delete(id int64) error
- func (mdb MemDB) Get(id int64) (Item, error)
- func (mdb MemDB) GetAll(limit, skip int64) ([]Item, error)
- func (mdb MemDB) GetAllByIndex(indexName string, value interface{}) ([]Item, error)
- func (mdb MemDB) Iterate(fn func(id int64, item Item) (stop bool, err error)) error
- func (mdb *MemDB) LoadDB(dataType interface{}) error
- func (mdb *MemDB) ReindexAll()
- func (mdb *MemDB) SaveDB(dataType interface{}) error
- func (mdb *MemDB) Update(id int64, item Item) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type MemDB ¶
type MemDB struct {
// contains filtered or unexported fields
}
func (*MemDB) AddIndex ¶
AddIndex adds secondary index by name You should provide GetIndex(name) method on your Item interface implementation
func (*MemDB) CleanUp ¶
func (mdb *MemDB) CleanUp()
Clean deleted items Iterate all DB and create a new
func (MemDB) GetAllByIndex ¶
func (*MemDB) ReindexAll ¶
func (mdb *MemDB) ReindexAll()
Click to show internal directories.
Click to hide internal directories.