Documentation
¶
Index ¶
- type ActiveMap
- type Result
- type StableMap
- func (sm *StableMap[K, V]) AsMap() map[K]V
- func (sm *StableMap[K, V]) Clone() *StableMap[K, V]
- func (sm *StableMap[K, V]) Delete(k K) error
- func (sm *StableMap[K, V]) DeleteAt(i int)
- func (sm *StableMap[K, V]) Entries() iter.Seq2[K, V]
- func (sm *StableMap[K, V]) Get(k K) (V, bool)
- func (sm *StableMap[K, V]) GetAt(i int) V
- func (sm *StableMap[K, V]) Import(b *StableMap[K, V])
- func (sm *StableMap[K, V]) Incorporate(m map[K]V)
- func (sm *StableMap[K, V]) IndexOf(key K) int
- func (sm *StableMap[K, V]) Length() int
- func (sm *StableMap[K, V]) MarshalBinary() ([]byte, error)
- func (sm StableMap[K, V]) MarshalJSON() ([]byte, error)
- func (sm *StableMap[K, V]) Set(key K, val V) error
- func (sm *StableMap[K, V]) UnmarshalBinary(p []byte) error
- func (sm *StableMap[K, V]) UnmarshalJSON(b []byte) error
- func (sm *StableMap[K, V]) Unshift(key K, val V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveMap ¶ added in v0.0.4
type ActiveMap[K comparable, V any] struct { *StableMap[K, V] Events chan Result[K, V] }
ActiveMap is a StableMap that emits events when it mutates.
func NewActiveMap ¶ added in v0.0.4
func NewActiveMap[K comparable, V any]() *ActiveMap[K, V]
NewActiveMap instantiates a new ActiveMap
type Result ¶ added in v0.0.4
type Result[K comparable, V any] struct { Action string Key K OldVal V NewVal V Msg string }
A Result is emitted whenever an ActiveMap mutates
type StableMap ¶
type StableMap[K comparable, V any] struct { *sync.RWMutex // contains filtered or unexported fields }
StableMap is a map whose keys are ordered, and whose operations are concurrency safe and which marshals itself into predictable, deterministic bytes.
func From ¶ added in v0.0.3
func From[K comparable, V any](m map[K]V) *StableMap[K, V]
func New ¶
func New[K comparable, V any]() *StableMap[K, V]
func (*StableMap[K, V]) Get ¶
get a value and a bolean indicating if there actually was something there
func (*StableMap[K, V]) Incorporate ¶ added in v0.0.3
func (sm *StableMap[K, V]) Incorporate(m map[K]V)
Incorporate incoporates a map, merging it with existing entries
func (*StableMap[K, V]) MarshalBinary ¶
func (StableMap[K, V]) MarshalJSON ¶ added in v0.0.3
func (*StableMap[K, V]) UnmarshalBinary ¶
func (*StableMap[K, V]) UnmarshalJSON ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.