Documentation ¶
Index ¶
- Variables
- type Cellar
- func (c *Cellar) Begin(writable bool) (*Tx, error)
- func (c *Cellar) Close() error
- func (c *Cellar) ForceMerge()
- func (c *Cellar) GoString() string
- func (c *Cellar) Path() string
- func (c *Cellar) Stats() *Stats
- func (c *Cellar) String() string
- func (c *Cellar) Update(fn func(*Tx) error) error
- func (c *Cellar) View(fn func(*Tx) error) error
- type Cursor
- type Merge
- type MergePolicy
- type Options
- type SimpleMergePolicy
- type Stats
- type Tx
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTxClosed is returned whe operating on a closed cellar/bolt ErrTxClosed = errors.New("tx closed") // ErrTxNotWritable is returned when attempting a write operation on a // read only transaction ErrTxNotWritable = errors.New("tx not writable") // ErrTxIsManaged is returned when commit/rollback has been performed // on a managed transaction (Update/View) ErrTxIsManaged = errors.New("managed tx rollback/commit not allowed") )
var DefaultOptions = &Options{ AutomaticMerge: true, }
DefaultOptions give the standard cellar behavior
Logger is a configurable logger used by this package by default output is discarded
Functions ¶
This section is empty.
Types ¶
type Cellar ¶
type Cellar struct {
// contains filtered or unexported fields
}
Cellar is a merged-multi-segment(bolt) k/v store
func Open ¶
Open is used to create/open a cellar path should be a directory to hold the cellar contents if options is nil, DefaultOptions will be used
func (*Cellar) Begin ¶
Begin starts a new transaction writable controls whether or not this transaction supports Put/Delete
func (*Cellar) Close ¶
Close will release all resources associated with the cellar close may block while waiting for readers/mergers to complete or reach a resumable point
func (*Cellar) ForceMerge ¶
func (c *Cellar) ForceMerge()
ForceMerge will force the cellar to perform a merge operations this function does not wait for the merge to finish
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor is a tool for iterating through k/v pairs in the cellar
type Merge ¶
type Merge struct {
// contains filtered or unexported fields
}
Merge represents an ordered set of adjacent segments to be merged dropDeletes specifies whether or not the deletes should be dropped deletes can only be dropped if the result of the merge is the final segment
type MergePolicy ¶
MergePolicy is anything which can prescribe a set of Merges to be done
type Options ¶
type Options struct {
AutomaticMerge bool
}
Options let you change configurable behavior within the cellar
type SimpleMergePolicy ¶
type SimpleMergePolicy struct{}
SimpleMergePolicy has no brain at all, it simply always chooses to merge two consecutive segments that are not already being merged
func (*SimpleMergePolicy) Merges ¶
func (s *SimpleMergePolicy) Merges(cellar *Cellar, segments segmentList) []*Merge
Merges returns the set of prescribed merge operations for this set of segments
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats returns interesting values about performance/behavior of the cellar
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx represents a cellar transaction
func (*Tx) Commit ¶
Commit will atomically make all the operations in the transactions a part of this cellar
func (*Tx) Get ¶
Get will look up the specified key if theere is no value, nil is returned NOTE: an empty byte slice is a valid value, and not the same as nil