Documentation ¶
Overview ¶
Package listmap implements an ordered doubly linked list map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor represents a cursor in the map.
func (*Cursor) Key ¶
Key returns the key of the element at the current location of the cursor. The returned slice is a subslice of the memory-mapped file, so modifications may lead to corruption of the list.
func (*Cursor) Next ¶
Next moves the cursor to the next element in the Listmap and returns a pointer to itself or nil if the end of the list is reached. This modifies the original cursor.
type Listmap ¶
type Listmap struct {
// contains filtered or unexported fields
}
Listmap represents an ordered doubly linked list map.
func NewListmap ¶
NewListmap returns a pointer to an initialized list backed by file or nil in the case of an error. file will be truncated.
func OpenListmap ¶
OpenListmap returns a pointer to an existing Listmap backed by file or nil in the case of an error.
func (*Listmap) Destroy ¶
func (l *Listmap) Destroy()
Destroy closes an initialized Listmap and removes its associated file.
func (*Listmap) NewCursor ¶
NewCursor returns a pointer to a cursor positioned at the first element of the Listmap.