Documentation ¶
Index ¶
- type Find
- type Item
- type List
- func (l *List) Clr()
- func (l *List) Del(ver uint64, meth Find) *Item
- func (l *List) Exp(ver uint64, meth Find) *Item
- func (l *List) Get(ver uint64, meth Find) *Item
- func (l *List) Len() int
- func (l *List) Max() *Item
- func (l *List) Min() *Item
- func (l *List) Put(ver uint64, val []byte) *Item
- func (l *List) Rng(beg, end uint64, fn func(*Item) bool)
- func (l *List) Walk(fn func(*Item) bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Find ¶
type Find int8
Find determines which method is used to seek items in the list.
const ( // Exact returns an item at a specific version from the list. If the exact // item does not exist in the list, then a nil value is returned. Exact Find = iota // Prev returns the nearest item in the list, where the version number is // less than the given version. In a time-series list, this can be used // to get the version that was valid before a specified time. Prev // Next returns the nearest item in the list, where the version number is // greater than the given version. In a time-series list, this can be used // to get the version that was changed after a specified time. Next // Upto returns the nearest item in the list, where the version number is // less than or equal to the given version. In a time-series list, this can // be used to get the version that was current at the specified time. Upto // Nearest returns an item nearest a specific version in the list. If there // is a previous version to the given version, then it will be returned, // otherwise it will return the next available version. Nearest )
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents an item in an in-memory btree.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents an in-memory binary list.
func (*List) Del ¶
Del deletes a specific item from the list, returning the previous item if it existed. If it did not exist, a nil value is returned.
func (*List) Exp ¶
Exp expunges all items in the list, upto and including the specified version, returning the latest version, or a nil value if not found.
func (*List) Get ¶
Get gets a specific item from the list. If the exact item does not exist in the list, then a nil value is returned.
func (*List) Max ¶
Max returns the last item in the list. In a time-series list this can be used to get the latest version.
func (*List) Min ¶
Min returns the first item in the list. In a time-series list this can be used to get the initial version.
func (*List) Put ¶
Put inserts a new item into the list, ensuring that the list is sorted after insertion. If an item with the same version already exists in the list, then the value is updated.