Documentation
¶
Index ¶
- func ListenMulti[L any, R any](ctx context.Context, nl *V[L], nr *V[R], fn func(context.Context, L, R) error) error
- func MapDelete[M ~map[K]T, K comparable, T any](m *V[M], k K)
- func MapDeleteFunc[M ~map[K]T, K comparable, T any](m *V[M], del func(K, T) bool)
- func MapPut[M ~map[K]T, K comparable, T any](m *V[M], k K, v T)
- func SliceAppend[S []T, T any](v *V[S], val T)
- func SliceRemove[S []T, T comparable](v *V[S], val T)
- type V
- func (v *V[T]) Get(ctx context.Context, version uint64) (T, uint64, error)
- func (v *V[T]) GetAny(ctx context.Context) (T, uint64, error)
- func (v *V[T]) Listen(ctx context.Context, f func(t T) error) error
- func (v *V[T]) Notify(ctx context.Context) <-chan T
- func (v *V[T]) Peek() (T, error)
- func (v *V[T]) Set(t T)
- func (v *V[T]) Sync(f func())
- func (v *V[T]) Update(f func(t T) T)
- func (v *V[T]) UpdateOpt(f func(t T) (T, bool)) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenMulti ¶ added in v0.9.0
func MapDelete ¶ added in v0.8.0
func MapDelete[M ~map[K]T, K comparable, T any](m *V[M], k K)
func MapDeleteFunc ¶ added in v0.8.0
func MapDeleteFunc[M ~map[K]T, K comparable, T any](m *V[M], del func(K, T) bool)
func MapPut ¶ added in v0.8.0
func MapPut[M ~map[K]T, K comparable, T any](m *V[M], k K, v T)
func SliceAppend ¶ added in v0.8.0
func SliceRemove ¶ added in v0.8.0
func SliceRemove[S []T, T comparable](v *V[S], val T)
Types ¶
Click to show internal directories.
Click to hide internal directories.