types

package
v0.10.13 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrComparisonNil = fmt.Errorf("comparison function cannot be nil")
	ErrEqualNil      = fmt.Errorf("equality function cannot be nil")
	ErrFuncNil       = fmt.Errorf("function cannot be nil")
)

Functions

This section is empty.

Types

type BidIterator

type BidIterator[V any] interface {
	Iterator[V]
	Prev() BidIterator[V]
}

BidIterator is an interface of const bidirectional iterator

type FakeLocker

type FakeLocker struct{}

func (FakeLocker) Lock

func (FakeLocker) Lock()

func (FakeLocker) RLock

func (FakeLocker) RLock()

func (FakeLocker) RUnlock

func (FakeLocker) RUnlock()

func (FakeLocker) Unlock

func (FakeLocker) Unlock()

type Iterator

type Iterator[V any] interface {
	IsValid() bool
	Next() Iterator[V]
	Value() V
	Clone() Iterator[V]
	Equal(other Iterator[V]) bool
}

Iterator is an interface of const iterator

type KvBidIterator

type KvBidIterator[K, V any] interface {
	KvIterator[K, V]
	MutableBidIterator[V]
}

KvBidIterator is an interface of const key-value type bidirectional iterator

type KvIterator

type KvIterator[K, V any] interface {
	Iterator[V]
	Key() K
}

KvIterator is an interface of const key-value type iterator

type Locker

type Locker interface {
	Lock()
	Unlock()
	RLock()
	RUnlock()
}

type Map

type Map[K, V any] interface {
	Get(key K) (V, bool)
	Set(key K, value V)
	Remove(key K) bool
	Has(key K) bool

	Clear()
	Len() int
	IsEmpty() bool

	Keys() []K
	Values() []V
	Range(func(key K, value V) bool)
}

Map represents a generic map interface that can be implemented by different map types like HashMap, TreeMap, LinkedHashMap, SkipListMap, BTreeMap, etc.

type MutableBidIterator

type MutableBidIterator[V any] interface {
	BidIterator[V]
	SetValue(value V)
}

MutableBidIterator is an interface of mutable bidirectional iterator

type MutableIterator

type MutableIterator[V any] interface {
	Iterator[V]
	SetValue(value V)
}

MutableIterator is an interface of mutable iterator

type MutableKvBidIterator

type MutableKvBidIterator[K, V any] interface {
	MutableKvIterator[K, V]
	MutableBidIterator[V]
}

MutableKvBidIterator is an interface of mutable key-value type bidirectional iterator

type MutableKvIterator

type MutableKvIterator[K, V any] interface {
	KvIterator[K, V]
	SetValue(value V)
}

MutableKvIterator is an interface of mutable key-value type iterator

type RandomAccessIterator

type RandomAccessIterator[V any] interface {
	MutableBidIterator[V]
	// IteratorAt returns a new iterator at position
	IteratorAt(position int) RandomAccessIterator[V]
	Position() int
}

RandomAccessIterator is an interface of mutable random access iterator

Jump to

Keyboard shortcuts

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