index

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeySplitIndex

type KeySplitIndex[T any] struct {
	Node[T]
}

func (*KeySplitIndex[T]) MarshalJSON

func (n *KeySplitIndex[T]) MarshalJSON() ([]byte, error)

func (*KeySplitIndex[T]) UnmarshalJSON

func (n *KeySplitIndex[T]) UnmarshalJSON(bytes []byte) error

type Node

type Node[T any] struct {
	sync.Locking
	// contains filtered or unexported fields
}

func (*Node[T]) ByPrefix

func (n *Node[T]) ByPrefix(s string) []T

func (*Node[T]) Collect

func (n *Node[T]) Collect() (values []T)

func (*Node[T]) Contains

func (n *Node[T]) Contains(s string) bool

func (*Node[T]) Get

func (n *Node[T]) Get(s string) (out T)

func (*Node[T]) Remove

func (n *Node[T]) Remove(s string) (out T)

func (*Node[T]) Set

func (n *Node[T]) Set(name string, value T)

func (*Node[T]) SetValue

func (n *Node[T]) SetValue(value T)

func (*Node[T]) UnsetValue

func (n *Node[T]) UnsetValue()

func (*Node[T]) Update

func (n *Node[T]) Update(name string, f NodeUpdateFunc[T])

func (*Node[T]) Value

func (n *Node[T]) Value() (v T)

type NodeMap

type NodeMap[T any] map[string]*Node[T]

type NodeUpdateFunc

type NodeUpdateFunc[T any] func(current T) (newValue T)

type PrefixSuffix

type PrefixSuffix[T any] struct {
	// contains filtered or unexported fields
}

PrefixSuffix index combines two KeySplitIndexes to simplify indexing and searching by prefix and suffix

func (*PrefixSuffix[T]) ByPrefix

func (f *PrefixSuffix[T]) ByPrefix(prefix string) []T

func (*PrefixSuffix[T]) BySuffix

func (f *PrefixSuffix[T]) BySuffix(suffix string) []T

func (*PrefixSuffix[T]) Contains

func (f *PrefixSuffix[T]) Contains(key string) bool

func (*PrefixSuffix[T]) Get

func (f *PrefixSuffix[T]) Get(key string) T

func (*PrefixSuffix[T]) Remove

func (f *PrefixSuffix[T]) Remove(key string)

func (*PrefixSuffix[T]) Set

func (f *PrefixSuffix[T]) Set(key string, value T)

func (*PrefixSuffix[T]) Update

func (f *PrefixSuffix[T]) Update(key string, fn NodeUpdateFunc[T])

Jump to

Keyboard shortcuts

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