Documentation ¶
Index ¶
- Variables
- func DecodeIndexData(buf []byte, items ...interface{}) error
- func EncodeIndexConfig(t *IndexConfig) []byte
- func EncodeTableConfig(t *TableConfig) []byte
- type DB
- func (this *DB) Close() error
- func (this *DB) CreateItem(item Item) error
- func (this *DB) CreateTable(tableName string, indexConfigs map[string]*IndexConfig) error
- func (this *DB) DeleteItem(tableName string, itemKey string) error
- func (this *DB) EachIndex(opt IteratorOptions) error
- func (this *DB) EachItem(opt IteratorOptions) error
- func (this *DB) GC()
- func (this *DB) GetItem(itemKey string, item Item) error
- func (this *DB) HasItem(tableName string, itemKey string) (bool, error)
- func (this *DB) NextID(seq *badger.Sequence) (uint64, error)
- func (this *DB) SaveItem(item Item) error
- func (this *DB) Update(fn func(txn *badger.Txn) error, runBefore func()) error
- func (this *DB) UpdateItem(item Item) error
- func (this *DB) View(fn func(txn *badger.Txn) error, runBefore func()) error
- type Index
- type IndexConfig
- type Item
- type ItemIndexes
- type IteratorOptions
- type MultiError
- type Options
- type Table
- type TableConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecodeIndexData ¶
func EncodeIndexConfig ¶
func EncodeIndexConfig(t *IndexConfig) []byte
func EncodeTableConfig ¶
func EncodeTableConfig(t *TableConfig) []byte
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateTable ¶
func (this *DB) CreateTable(tableName string, indexConfigs map[string]*IndexConfig) error
func (*DB) EachIndex ¶
func (this *DB) EachIndex(opt IteratorOptions) error
func (*DB) EachItem ¶
func (this *DB) EachItem(opt IteratorOptions) error
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func (*Index) Config ¶
func (this *Index) Config() *IndexConfig
type IndexConfig ¶
type IndexConfig struct { TableName string ID uint64 Name string Unique bool // not used now Deleted bool // not used now }
func DecodeIndexConfig ¶
func DecodeIndexConfig(b []byte) (*IndexConfig, error)
type ItemIndexes ¶
index name = > index key
func (*ItemIndexes) Marshal ¶
func (this *ItemIndexes) Marshal() []byte
func (*ItemIndexes) Unmarshal ¶
func (this *ItemIndexes) Unmarshal(data []byte) error
type IteratorOptions ¶
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
func NewMultiError ¶
func NewMultiError() *MultiError
func (*MultiError) Add ¶
func (this *MultiError) Add(err error)
func (*MultiError) Error ¶
func (this *MultiError) Error() string
func (*MultiError) HasErrors ¶
func (this *MultiError) HasErrors() bool
type TableConfig ¶
func DecodeTableConfig ¶
func DecodeTableConfig(b []byte) (*TableConfig, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.