Versions in this module Expand all Collapse all v0 v0.2.1 Oct 9, 2026 v0.2.0 Oct 8, 2026 Changes in this version + const MaxAtomicOps + const MaxUpdates + const RevisionField + var ErrConditionFailed = errors.New("celerity: condition not met") + var ErrInvalidCondition = errors.New("celerity: invalid condition") + var ErrInvalidCursor = errors.New("celerity: cursor did not come from this store") + var ErrInvalidRevision = errors.New("celerity: revision did not come from a read") + var ErrInvalidUpdate = errors.New("celerity: invalid update") + var ErrNotFound = errors.New("celerity: not found") + var ErrNotSupported = errors.New("celerity: not supported by this data store") + var ErrTooManyOperations = errors.New("celerity: too many operations in one request") + var ErrWrongPartition = errors.New("celerity: operation outside the write's partition") + var Unrevisioned = Revision + func DeliverRevisions(out any, revisions []Revision) + func Items[T any](ctx context.Context, store Client, q Query) iter.Seq2[T, error] + func Scanned[T any](ctx context.Context, store Client, s Scan) iter.Seq2[T, error] + type AtomicOp struct + Item any + Key Key + Options WriteOptions + Updates []Update + func AtomicDelete(key Key, opts ...WriteOption) AtomicOp + func AtomicPut(key Key, item any, opts ...WriteOption) AtomicOp + func AtomicUpdate(key Key, updates []Update, opts ...WriteOption) AtomicOp + func (o AtomicOp) IsDelete() bool + func (o AtomicOp) IsPut() bool + func (o AtomicOp) IsUpdate() bool + type BatchOp struct + Item any + Key Key + func DeleteOp(key Key) BatchOp + func PutOp(key Key, item any) BatchOp + func (o BatchOp) IsDelete() bool + type Client interface + Atomically func(ctx context.Context, partition string, ops []AtomicOp) error + BatchGet func(ctx context.Context, keys []Key, out any) ([]Key, error) + BatchWrite func(ctx context.Context, ops []BatchOp) ([]BatchOp, error) + Delete func(ctx context.Context, key Key, opts ...WriteOption) error + Get func(ctx context.Context, key Key, out any) (Revision, error) + Put func(ctx context.Context, key Key, item any, opts ...WriteOption) (Revision, error) + Query func(ctx context.Context, q Query, out any) (Cursor, error) + Scan func(ctx context.Context, s Scan, out any) (Cursor, error) + Update func(ctx context.Context, key Key, updates []Update, opts ...WriteOption) (Revision, error) + type Condition struct + High any + Name string + Of []Condition + Op Operator + Value any + func All(conditions ...Condition) Condition + func Any(conditions ...Condition) Condition + func Between(name string, low, high any) Condition + func Contains(name string, value any) Condition + func Eq(name string, value any) Condition + func Exists(name string) Condition + func Ge(name string, value any) Condition + func Gt(name string, value any) Condition + func Le(name string, value any) Condition + func Lt(name string, value any) Condition + func Ne(name string, value any) Condition + func NotExists(name string) Condition + func StartsWith(name, prefix string) Condition + type Cursor string + func (c Cursor) More() bool + type Key struct + Partition string + Sort string + type Operator string + const OpAnd + const OpBetween + const OpContains + const OpEqual + const OpExists + const OpGreater + const OpGreaterOrEqual + const OpLess + const OpLessOrEqual + const OpNotEqual + const OpNotExists + const OpOr + const OpStartsWith + type Query struct + Cursor string + Descending bool + Filter *Condition + Index string + Limit int + Partition string + Project []string + Sort *SortCondition + type Revision struct + func NewRevision(value string) Revision + func (r Revision) Known() bool + func (r Revision) Value() (string, bool) + type RevisionReceiver interface + SetRevision func(Revision) + type Scan struct + Cursor string + Filter *Condition + Limit int + Project []string + type SortCondition struct + High string + Op Operator + Value string + func SortBetween(low, high string) *SortCondition + func SortEqual(value string) *SortCondition + func SortGreater(value string) *SortCondition + func SortGreaterOrEqual(value string) *SortCondition + func SortLess(value string) *SortCondition + func SortLessOrEqual(value string) *SortCondition + func SortStartsWith(prefix string) *SortCondition + type Update struct + By float64 + Kind UpdateKind + Path string + Value any + func Increment(path string, by float64) Update + func Remove(path string) Update + func Set(path string, value any) Update + type UpdateKind string + const UpdateIncrement + const UpdateRemove + const UpdateSet + type WriteOption func(*WriteOptions) + func If(condition Condition) WriteOption + func IfUnchanged(revision Revision) WriteOption + type WriteOptions struct + Condition *Condition + Revision *Revision + func ResolveWriteOptions(opts []WriteOption) WriteOptions