Documentation ¶
Index ¶
- Variables
- func BatchWrite(e *badger.Entry)
- func DB() *badger.DB
- func Init(config Config) error
- func MustInit(config Config)
- func Update(fn func(txn *badger.Txn) error) (err error)
- func View(fn func(txn *badger.Txn) error) (err error)
- type Allocator
- type Config
- type IterOption
- func (o *IterOption) Backward() bool
- func (o *IterOption) OffsetKey() []byte
- func (o *IterOption) OnClose(key []byte)
- func (o *IterOption) SetBackward() *IterOption
- func (o *IterOption) SetForward() *IterOption
- func (o *IterOption) SetOffsetKey(offset []byte) *IterOption
- func (o *IterOption) SetOnClose(f func(key []byte)) *IterOption
- type ListOption
- func (o *ListOption) Backward() bool
- func (o *ListOption) Limit() int32
- func (o *ListOption) SetBackward() *ListOption
- func (o *ListOption) SetForward() *ListOption
- func (o *ListOption) SetLimit(limit int32) *ListOption
- func (o *ListOption) SetSkip(skip int32) *ListOption
- func (o *ListOption) Skip() int32
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultConfig = Config{ DirPath: "./_hdd", ConflictRetries: 100, ConflictMaxInterval: time.Millisecond, BatchSize: defaultBatchSize, BatchWorkers: defaultBatchWorkers, } )
Functions ¶
func BatchWrite ¶ added in v0.3.2
func BatchWrite(e *badger.Entry)
BatchWrite is the helper function to set the entry backed by an internal flusher. Which makes writes faster but there is no guarantee that write has been done successfully, since we bypass the errors. TODO:: Maybe improve the flusher structure to return error in the case
Types ¶
type Allocator ¶ added in v0.2.6
type Allocator struct {
// contains filtered or unexported fields
}
func NewAllocator ¶ added in v0.2.6
func NewAllocator() *Allocator
func (*Allocator) ReleaseAll ¶ added in v0.2.6
func (bk *Allocator) ReleaseAll()
type IterOption ¶ added in v0.3.15
type IterOption struct {
// contains filtered or unexported fields
}
func NewIterOption ¶ added in v0.3.15
func NewIterOption() *IterOption
func (*IterOption) Backward ¶ added in v0.3.15
func (o *IterOption) Backward() bool
func (*IterOption) OffsetKey ¶ added in v0.3.15
func (o *IterOption) OffsetKey() []byte
func (*IterOption) OnClose ¶ added in v0.3.15
func (o *IterOption) OnClose(key []byte)
func (*IterOption) SetBackward ¶ added in v0.3.15
func (o *IterOption) SetBackward() *IterOption
func (*IterOption) SetForward ¶ added in v0.3.15
func (o *IterOption) SetForward() *IterOption
func (*IterOption) SetOffsetKey ¶ added in v0.3.15
func (o *IterOption) SetOffsetKey(offset []byte) *IterOption
func (*IterOption) SetOnClose ¶ added in v0.3.15
func (o *IterOption) SetOnClose(f func(key []byte)) *IterOption
type ListOption ¶ added in v0.3.10
type ListOption struct {
// contains filtered or unexported fields
}
func NewListOption ¶ added in v0.3.10
func NewListOption() *ListOption
func (*ListOption) Backward ¶ added in v0.3.10
func (o *ListOption) Backward() bool
func (*ListOption) Limit ¶ added in v0.3.10
func (o *ListOption) Limit() int32
func (*ListOption) SetBackward ¶ added in v0.3.10
func (o *ListOption) SetBackward() *ListOption
func (*ListOption) SetForward ¶ added in v0.3.10
func (o *ListOption) SetForward() *ListOption
func (*ListOption) SetLimit ¶ added in v0.3.10
func (o *ListOption) SetLimit(limit int32) *ListOption
func (*ListOption) SetSkip ¶ added in v0.3.10
func (o *ListOption) SetSkip(skip int32) *ListOption
func (*ListOption) Skip ¶ added in v0.3.10
func (o *ListOption) Skip() int32
Click to show internal directories.
Click to hide internal directories.