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]) 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]) 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 SortFunction
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 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 SortFunction ¶
type SortFunction[K constraints.Ordered] func(data []K, i, j int) bool
Click to show internal directories.
Click to hide internal directories.