Documentation ¶
Index ¶
- func Compare[K, T comparable](a, b map[K]T) bool
- type Bucket
- func (b Bucket[V]) Bucket(pfx string) *Bucket[V]
- func (b Bucket[V]) Delete(k string)
- func (b Bucket[V]) Exists(k string) bool
- func (b Bucket[V]) ForEach(fn func(k string, v V))
- func (b Bucket[V]) Get(k string) V
- func (b Bucket[V]) GetFull(k string) (V, bool)
- func (b Bucket[V]) Iter() types.Iterator[string, V]
- func (b Bucket[V]) Keys() (keys []string)
- func (b Bucket[V]) Len() int
- func (b Bucket[V]) Set(k string, v V)
- func (b Bucket[V]) Values() (values []V)
- func (b Bucket[V]) Watch(ctx context.Context) types.Watcher[string, V]
- type Map
- func (m *Map[K, V]) Commit(fn func(data map[K]V))
- func (m *Map[K, V]) Copy() *Map[K, V]
- func (m *Map[K, V]) Delete(k K)
- func (m *Map[K, V]) Eventfull(ctx context.Context, buf int) *Map[K, V]
- func (m *Map[K, V]) Exists(k K) bool
- func (m *Map[K, V]) ForEach(fn func(k K, v V))
- func (m *Map[K, V]) Get(k K) V
- func (m *Map[K, V]) GetFull(k K) (obj V, exists bool)
- func (m *Map[K, V]) Iter() types.Iterator[K, V]
- func (m *Map[K, V]) Keys() (keys []K)
- func (m *Map[K, V]) Len() int
- func (m *Map[K, V]) MarshalCBOR() ([]byte, error)
- func (m *Map[K, V]) MarshalJSON() ([]byte, error)
- func (m *Map[K, V]) ReadOnly() *Map[K, V]
- func (m *Map[K, V]) Safe() *Map[K, V]
- func (m *Map[K, V]) Set(k K, v V)
- func (m *Map[K, V]) String() string
- func (m *Map[K, V]) UnmarshalCBOR(data []byte) error
- func (m *Map[K, V]) UnmarshalJSON(data []byte) error
- func (m *Map[K, V]) Values() (values []V)
- type OrderedMap
- func (m *OrderedMap[K, V]) Commit(fn func(data map[K]V))
- func (m *OrderedMap[K, V]) Copy() *OrderedMap[K, V]
- func (m *OrderedMap[K, V]) Delete(k K)
- func (m *OrderedMap[K, V]) ForEach(fn func(k K, v V))
- func (m *OrderedMap[K, V]) Iter() types.Iterator[K, V]
- func (m *OrderedMap[K, V]) Keys() (keys []K)
- func (m *OrderedMap[K, V]) ReadOnly() *OrderedMap[K, V]
- func (m *OrderedMap[K, V]) Safe() *OrderedMap[K, V]
- func (m *OrderedMap[K, V]) Set(k K, v V)
- func (m *OrderedMap[K, V]) Values() (values []V)
- type WeightedMap
- func (m *WeightedMap[K, V]) Commit(fn func(data map[K]types.Weighted[V]))
- func (m *WeightedMap[K, V]) Copy() *WeightedMap[K, V]
- func (m *WeightedMap[K, V]) Delete(k K)
- func (m *WeightedMap[K, V]) ForEach(fn func(k K, v V))
- func (m *WeightedMap[K, V]) Get(k K) V
- func (m *WeightedMap[K, V]) GetFull(k K) (obj V, exists bool)
- func (m *WeightedMap[K, V]) Iter() types.Iterator[K, V]
- func (m *WeightedMap[K, V]) Keys() (keys []K)
- func (m *WeightedMap[K, V]) MarshalCBOR() ([]byte, error)
- func (m *WeightedMap[K, V]) MarshalJSON() ([]byte, error)
- func (m *WeightedMap[K, V]) ReadOnly() *WeightedMap[K, V]
- func (m *WeightedMap[K, V]) Safe() *WeightedMap[K, V]
- func (m *WeightedMap[K, V]) Set(k K, v V)
- func (m *WeightedMap[K, V]) SetWeighted(k K, v types.Weighted[V])
- func (m *WeightedMap[K, V]) String() string
- func (m *WeightedMap[K, V]) UnmarshalCBOR(data []byte) error
- func (m *WeightedMap[K, V]) UnmarshalJSON(data []byte) error
- func (m *WeightedMap[K, V]) Values() (values []V)
- func (m *WeightedMap[K, V]) WeightIter() <-chan types.Iterator[K, V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare[K, T comparable](a, b map[K]T) bool
Types ¶
type Map ¶
type Map[K comparable, V any] struct { *channel.Hub[types.WatchMsg[K, V]] // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any](data map[K]V) *Map[K, V]
func (*Map[K, V]) Commit ¶
func (m *Map[K, V]) Commit(fn func(data map[K]V))
run function with direct access to Map
func (*Map[K, V]) MarshalCBOR ¶
func (*Map[K, V]) MarshalJSON ¶
func (*Map[K, V]) UnmarshalCBOR ¶
func (*Map[K, V]) UnmarshalJSON ¶
type OrderedMap ¶
type OrderedMap[K constraints.Ordered, V any] struct { Map[K, V] // contains filtered or unexported fields }
func NewOrdered ¶
func NewOrdered[K constraints.Ordered, V any](data map[K]V, lessFunc types.SortFunction[K]) *OrderedMap[K, V]
func (*OrderedMap[K, V]) Commit ¶
func (m *OrderedMap[K, V]) Commit(fn func(data map[K]V))
run function with direct access to Map
func (*OrderedMap[K, V]) ForEach ¶
func (m *OrderedMap[K, V]) ForEach(fn func(k K, v V))
range over Map
func (*OrderedMap[K, V]) Iter ¶
func (m *OrderedMap[K, V]) Iter() types.Iterator[K, V]
return iterator for safe iterating over Map
func (*OrderedMap[K, V]) ReadOnly ¶
func (m *OrderedMap[K, V]) ReadOnly() *OrderedMap[K, V]
return ReadOnly Map
func (*OrderedMap[K, V]) Values ¶
func (m *OrderedMap[K, V]) Values() (values []V)
return all Map values
type WeightedMap ¶
type WeightedMap[K comparable, V any] struct { Map[K, types.Weighted[V]] // contains filtered or unexported fields }
WeightedMap is a map of Weighted values. Higher weight means higher priority (descending).
func NewWeighted ¶
func NewWeighted[K comparable, V any](data map[K]types.Weighted[V]) *WeightedMap[K, V]
func NewWeightedMapFromSlice ¶
func NewWeightedMapFromSlice[K comparable, V any](keys []K, data []V) *WeightedMap[K, V]
func (*WeightedMap[K, V]) Commit ¶
func (m *WeightedMap[K, V]) Commit(fn func(data map[K]types.Weighted[V]))
run function with direct access to Map
func (*WeightedMap[K, V]) Copy ¶
func (m *WeightedMap[K, V]) Copy() *WeightedMap[K, V]
return Map copy
func (*WeightedMap[K, V]) ForEach ¶
func (m *WeightedMap[K, V]) ForEach(fn func(k K, v V))
range over Map
func (*WeightedMap[K, V]) GetFull ¶
func (m *WeightedMap[K, V]) GetFull(k K) (obj V, exists bool)
return value and existence of key
func (*WeightedMap[K, V]) Iter ¶
func (m *WeightedMap[K, V]) Iter() types.Iterator[K, V]
return iterator for safe iterating over Map
func (*WeightedMap[K, V]) MarshalCBOR ¶
func (m *WeightedMap[K, V]) MarshalCBOR() ([]byte, error)
func (*WeightedMap[K, V]) MarshalJSON ¶
func (m *WeightedMap[K, V]) MarshalJSON() ([]byte, error)
func (*WeightedMap[K, V]) ReadOnly ¶
func (m *WeightedMap[K, V]) ReadOnly() *WeightedMap[K, V]
func (*WeightedMap[K, V]) Safe ¶
func (m *WeightedMap[K, V]) Safe() *WeightedMap[K, V]
func (*WeightedMap[K, V]) SetWeighted ¶
func (m *WeightedMap[K, V]) SetWeighted(k K, v types.Weighted[V])
set value for key with weight
func (*WeightedMap[K, V]) String ¶
func (m *WeightedMap[K, V]) String() string
func (*WeightedMap[K, V]) UnmarshalCBOR ¶
func (m *WeightedMap[K, V]) UnmarshalCBOR(data []byte) error
func (*WeightedMap[K, V]) UnmarshalJSON ¶
func (m *WeightedMap[K, V]) UnmarshalJSON(data []byte) error
func (*WeightedMap[K, V]) Values ¶
func (m *WeightedMap[K, V]) Values() (values []V)
return all Map values
func (*WeightedMap[K, V]) WeightIter ¶
func (m *WeightedMap[K, V]) WeightIter() <-chan types.Iterator[K, V]
WeightIter... Returned iterators are in descending order.
Click to show internal directories.
Click to hide internal directories.