Documentation
¶
Index ¶
- type CompactChain
- func (m *CompactChain[K, V]) Add(key K, value V)
- func (m *CompactChain[K, V]) Count() int
- func (m *CompactChain[K, V]) Delete(key K, value V)
- func (m *CompactChain[K, V]) Exist(key K, value V) bool
- func (m *CompactChain[K, V]) Get(key K) ([]V, bool)
- func (m *CompactChain[K, V]) Iterate(fn func(key K, value V) bool)
- func (m *CompactChain[K, V]) IterateKeys(fn func(key K, values []V) bool)
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompactChain ¶
type CompactChain[K constraints.Ordered, V constraints.Ordered] struct { sync.RWMutex // contains filtered or unexported fields }
CompactChain is a map of slices of slices of empty structs
func NewCompactChain ¶
func NewCompactChain[K, V constraints.Ordered]() *CompactChain[K, V]
NewCompactChain creates a new CompactChain
func (*CompactChain[K, V]) Add ¶
func (m *CompactChain[K, V]) Add(key K, value V)
Add adds a key-value pair to the CompactChain
func (*CompactChain[K, V]) Count ¶
func (m *CompactChain[K, V]) Count() int
Count returns the total number of key-value pairs in the CompactChain
func (*CompactChain[K, V]) Delete ¶
func (m *CompactChain[K, V]) Delete(key K, value V)
Delete removes a key-value pair from the CompactChain
func (*CompactChain[K, V]) Exist ¶
func (m *CompactChain[K, V]) Exist(key K, value V) bool
Exist checks if a key-value pair exists in the CompactChain
func (*CompactChain[K, V]) Get ¶
func (m *CompactChain[K, V]) Get(key K) ([]V, bool)
Get retrieves the values associated with a key in the CompactChain
func (*CompactChain[K, V]) Iterate ¶
func (m *CompactChain[K, V]) Iterate(fn func(key K, value V) bool)
Iterate iterates over all key-value pairs in the CompactChain
func (*CompactChain[K, V]) IterateKeys ¶ added in v0.0.4
func (m *CompactChain[K, V]) IterateKeys(fn func(key K, values []V) bool)
Iterate iterates over all keys in the CompactChain
type Entry ¶
type Entry[K constraints.Ordered, V any] struct { Key K Chain *[]V }
Entry represents a key with its chain of values
Click to show internal directories.
Click to hide internal directories.