index

package
v0.0.0-...-9808f37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrieIndexVersion = 1

	HeaderHasPrefix   = 0b0000_0001
	HeaderHasValue    = 0b0000_0010
	HeaderHasChildren = 0b0000_0100
)
View Source
const BitmapIndexVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type BitmapIndex

type BitmapIndex struct {
	// contains filtered or unexported fields
}

func NewBitmapIndex

func NewBitmapIndex(b []byte) (*BitmapIndex, error)

func NewBitmapIndexFromXDR

func NewBitmapIndexFromXDR(index xdr.BitmapIndex) *BitmapIndex

func (*BitmapIndex) Buffer

func (i *BitmapIndex) Buffer() *bytes.Buffer

func (*BitmapIndex) DebugCompare

func (i *BitmapIndex) DebugCompare(j *BitmapIndex) string

DebugCompare returns a string that compares this bitmap to another bitmap byte-by-byte in binary form as two columns.

func (*BitmapIndex) Flush

func (i *BitmapIndex) Flush() []byte

Flush flushes the index data to byte slice in index format.

func (*BitmapIndex) Merge

func (i *BitmapIndex) Merge(other *BitmapIndex) error

func (*BitmapIndex) NextActiveBit

func (i *BitmapIndex) NextActiveBit(position uint32) (uint32, error)

NextActiveBit returns the next bit position (inclusive) where this index is active. "Inclusive" means that if it's already active at `position`, this returns `position`.

func (*BitmapIndex) SetActive

func (i *BitmapIndex) SetActive(index uint32) error

func (*BitmapIndex) SetInactive

func (i *BitmapIndex) SetInactive(index uint32) error

func (*BitmapIndex) Size

func (i *BitmapIndex) Size() int

func (*BitmapIndex) ToXDR

func (i *BitmapIndex) ToXDR() xdr.BitmapIndex

type NamedIndices

type NamedIndices map[string]*BitmapIndex

type TrieIndex

type TrieIndex struct {
	sync.RWMutex
	Root *trieNode `json:"root"`
}

func NewTrieIndexFromBytes

func NewTrieIndexFromBytes(r io.Reader) (*TrieIndex, error)

func (*TrieIndex) Get

func (index *TrieIndex) Get(key []byte) ([]byte, bool)

func (*TrieIndex) Iterate

func (index *TrieIndex) Iterate(f func(key, value []byte))

func (*TrieIndex) MarshalBinary

func (i *TrieIndex) MarshalBinary() ([]byte, error)

func (*TrieIndex) Merge

func (i *TrieIndex) Merge(other *TrieIndex) error

TODO: For now this ignores duplicates. should it error?

func (*TrieIndex) ReadFrom

func (i *TrieIndex) ReadFrom(r io.Reader) (int64, error)

func (*TrieIndex) UnmarshalBinary

func (i *TrieIndex) UnmarshalBinary(bytes []byte) error

func (*TrieIndex) Upsert

func (index *TrieIndex) Upsert(key, value []byte) ([]byte, bool)

func (*TrieIndex) WriteTo

func (i *TrieIndex) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL