Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index[Key any] interface { // Insert an ID. The first value returned is the index and the bool // indicates if an append is required. Insert(id Key) (int, bool) // Get by ID. If not found it should return (-1,false). If it is found the // first value is the index and the second value is True. Get(id Key) (int, bool) // Delete by ID. Removes the ID from the index, the value should be // recycled. This should be called before removing the value from the slice. Delete(id Key) (int, bool) // SliceLen of the Indexed slice. SliceLen() int // SetSliceLen can be used to grow the slice. SetSliceLen(int) // Next ID after the ID given Next(id Key) (Key, int) // Len fulfills slice.Lener. Indicates how many values are currently stored // in the index. Len() int }
Index a slice by a byte ID. Allows the equivalent of map[[]byte]<Type>. A slice of the desired type is kept seperatly and the Index values are managed.
type IndexFactory ¶
Directories ¶
Path | Synopsis |
---|---|
testsuite
Package testsuite provides tests to validate that an implementation of byteid.Index is correct.
|
Package testsuite provides tests to validate that an implementation of byteid.Index is correct. |
Package sliceidx provides SliceIdx as a building block for creating types that fulfill idx.Index.
|
Package sliceidx provides SliceIdx as a building block for creating types that fulfill idx.Index. |
Click to show internal directories.
Click to hide internal directories.