Versions in this module Expand all Collapse all v0 v0.1.0 Aug 11, 2026 Changes in this version + var ErrKeyExists = errors.New("data: key already exists") + var ErrNotFound = errors.New("data: record not found") + func Canonical(v View) []byte + type Agg struct + Field string + Func AggFunc + type AggFunc uint8 + const AggAvg + const AggCount + const AggMax + const AggMin + const AggSum + type Codec struct + Decode func(Record) R + Encode func(R) Record + type Field struct + Kind Kind + Name string + Rules []Rule + type Filter struct + Field string + Op FilterOp + Value Value + type FilterOp uint8 + const OpContains + const OpEq + const OpGe + const OpGt + const OpLe + const OpLt + const OpNe + type Group struct + Aggregates map[string]Value + Key Value + Rows []Record + type Kind uint8 + const KindBool + const KindFloat + const KindInt + const KindString + type MemoryProxy struct + func NewMemoryProxy(schema Schema, keyField string, seed ...Record) (*MemoryProxy, error) + func (m *MemoryProxy) List(_ context.Context) ([]Record, error) + func (m *MemoryProxy) Mutate(_ context.Context, mut Mutation) error + func (m *MemoryProxy) Query(_ context.Context, q Query) (View, error) + type Mutation struct + Key Value + Kind MutationKind + Record Record + type MutationKind uint8 + const MutDelete + const MutInsert + const MutUpdate + type Proxy interface + List func(ctx context.Context) ([]Record, error) + Mutate func(ctx context.Context, m Mutation) error + Query func(ctx context.Context, q Query) (View, error) + type Query struct + Aggs []Agg + Filters []Filter + GroupBy string + Limit int + Offset int + Sorts []Sort + type Record map[string]Value + type Rule func(Value) error + func NumMax(hi float64, msg string) Rule + func NumMin(lo float64, msg string) Rule + func Required(msg string) Rule + func StrMaxLen(n int, msg string) Rule + func StrMinLen(n int, msg string) Rule + type Schema struct + Fields []Field + func (s Schema) Field(name string) (Field, bool) + func (s Schema) Validate(r Record) error + type Sort struct + Desc bool + Field string + type Store struct + func NewStore[R any](proxy Proxy, codec Codec[R]) *Store[R] + func (s *Store[R]) Add(ctx context.Context, row R) error + func (s *Store[R]) Delete(ctx context.Context, key Value) error + func (s *Store[R]) Items() *mvvm.ObservableList[R] + func (s *Store[R]) Load(ctx context.Context) (View, error) + func (s *Store[R]) Query() Query + func (s *Store[R]) SetQuery(q Query) + func (s *Store[R]) Update(ctx context.Context, row R) error + type Value struct + Bool bool + Float float64 + Int int64 + Kind Kind + Str string + func Bool(b bool) Value + func Float(f float64) Value + func Int(i int64) Value + func String(s string) Value + type View struct + Aggregates map[string]Value + Groups []Group + Rows []Record + Total int + func Apply(records []Record, q Query) View