container

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BiMap

type BiMap[K, V comparable] struct {
	// contains filtered or unexported fields
}

func NewBiMap

func NewBiMap[K, V comparable](opts ...BiMapOption[K, V]) *BiMap[K, V]

func (*BiMap[K, V]) Delete

func (b *BiMap[K, V]) Delete(k K)

func (*BiMap[K, V]) Get

func (b *BiMap[K, V]) Get(k K) (V, bool)

func (*BiMap[K, V]) GetValue

func (b *BiMap[K, V]) GetValue(k K) V

func (*BiMap[K, V]) Has

func (b *BiMap[K, V]) Has(k K) bool

func (*BiMap[K, V]) Insert

func (b *BiMap[K, V]) Insert(k K, v V)

func (*BiMap[K, V]) Inverse

func (b *BiMap[K, V]) Inverse() *BiMap[V, K]

func (*BiMap[K, V]) Range

func (b *BiMap[K, V]) Range(f func(K, V) bool)

type BiMapOption

type BiMapOption[K, V comparable] interface {
	ApplyToBiMap(o *BiMapOptions[K, V])
}

type BiMapOptions

type BiMapOptions[K, V comparable] struct {
	Len *int
}

func (*BiMapOptions[K, V]) ApplyOptions

func (o *BiMapOptions[K, V]) ApplyOptions(opts []BiMapOption[K, V]) *BiMapOptions[K, V]

func (*BiMapOptions[K, V]) ApplyToBiMap

func (o *BiMapOptions[K, V]) ApplyToBiMap(o2 *BiMapOptions[K, V])

type IndexingMap

type IndexingMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*IndexingMap[K, V]) AddIndex

func (r *IndexingMap[K, V]) AddIndex(idx ...MapIndex[K, V])

func (*IndexingMap[K, V]) Delete

func (r *IndexingMap[K, V]) Delete(k K)

func (*IndexingMap[K, V]) Get

func (r *IndexingMap[K, V]) Get(k K) (V, bool)

func (*IndexingMap[K, V]) Put

func (r *IndexingMap[K, V]) Put(k K, v V)

func (*IndexingMap[K, V]) Range

func (r *IndexingMap[K, V]) Range(f func(K, V) bool)

type KeySlots

type KeySlots[K comparable] struct {
	// contains filtered or unexported fields
}

func NewKeySlots

func NewKeySlots[K comparable](slotsPerKey uint, keys []K) *KeySlots[K]

func (*KeySlots[K]) HasKey

func (s *KeySlots[K]) HasKey(key K) bool

func (*KeySlots[K]) Keys

func (s *KeySlots[K]) Keys() []K

func (*KeySlots[K]) Total

func (s *KeySlots[K]) Total() uint

Total returns the total number of slots.

func (*KeySlots[K]) Use

func (s *KeySlots[K]) Use(key K, slot uint) bool

func (*KeySlots[K]) UseNextFree

func (s *KeySlots[K]) UseNextFree() (K, uint, bool)

func (*KeySlots[K]) Used

func (s *KeySlots[K]) Used() uint

Used returns the used number of slots.

type MapIndex

type MapIndex[K comparable, V any] interface {
	Update(k K, old, new V)
	Put(k K, v V)
	Delete(k K, v V)
}

type ReverseMapIndex

type ReverseMapIndex[K, V comparable] map[V]sets.Set[K]

func (ReverseMapIndex[K, V]) Delete

func (r ReverseMapIndex[K, V]) Delete(k K, v V)

func (ReverseMapIndex[K, V]) Get

func (r ReverseMapIndex[K, V]) Get(v V) sets.Set[K]

func (ReverseMapIndex[K, V]) Put

func (r ReverseMapIndex[K, V]) Put(k K, v V)

func (ReverseMapIndex[K, V]) Update

func (r ReverseMapIndex[K, V]) Update(k K, old, new V)

type WithLen

type WithLen[K, V comparable] int

func (WithLen[K, V]) ApplyToBiMap

func (w WithLen[K, V]) ApplyToBiMap(o *BiMapOptions[K, V])

Jump to

Keyboard shortcuts

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