Versions in this module Expand all Collapse all v0 v0.1.1 Jul 13, 2026 v0.1.0 Jul 13, 2026 Changes in this version + var ErrMalformedDelta = errors.New("yin: malformed delta") + var ErrUnsupportedDelta = errors.New("yin: unsupported delta") + func MarshalDeltaJSON(delta Delta) ([]byte, error) + func MarshalJSONObject(fields *LWWMap[json.RawMessage]) ([]byte, error) + func MarshalLWWMapSnapshotJSON(fields *LWWMap[json.RawMessage]) ([]byte, error) + type Delta interface + Kind func() string + Version func() VersionVector + func UnmarshalLWWMapDeltaJSON[V any](data []byte) (Delta, error) + type DeltaCodec interface + DecodeDelta func([]byte) (Delta, error) + EncodeDelta func(Delta) ([]byte, error) + type Document interface + ApplyDelta func(d Delta) (changed bool) + Equal func(other Document) bool + ExtractDelta func(since VersionVector) Delta + Merge func(other Document) (changed bool) + Version func() VersionVector + type JSONLWWMapDeltaCodec struct + func NewJSONLWWMapDeltaCodec[V any]() JSONLWWMapDeltaCodec[V] + func (JSONLWWMapDeltaCodec[V]) DecodeDelta(data []byte) (Delta, error) + func (JSONLWWMapDeltaCodec[V]) EncodeDelta(d Delta) ([]byte, error) + type JSONLWWRegisterDeltaCodec struct + func NewJSONLWWRegisterDeltaCodec[T any]() JSONLWWRegisterDeltaCodec[T] + func (JSONLWWRegisterDeltaCodec[T]) DecodeDelta(data []byte) (Delta, error) + func (JSONLWWRegisterDeltaCodec[T]) EncodeDelta(d Delta) ([]byte, error) + type LWWMap struct + func NewLWWMap[V any](replica ReplicaID) *LWWMap[V] + func ParseJSONObject(replica ReplicaID, data []byte) (*LWWMap[json.RawMessage], error) + func UnmarshalLWWMapSnapshotJSON(replica ReplicaID, data []byte) (*LWWMap[json.RawMessage], error) + func (m *LWWMap[V]) ApplyDelta(d Delta) (changed bool) + func (m *LWWMap[V]) Delete(key string) + func (m *LWWMap[V]) Entries() map[string]V + func (m *LWWMap[V]) Equal(other Document) bool + func (m *LWWMap[V]) ExtractDelta(since VersionVector) Delta + func (m *LWWMap[V]) Get(key string) (value V, ok bool) + func (m *LWWMap[V]) Merge(other Document) (changed bool) + func (m *LWWMap[V]) Set(key string, value V) + func (m *LWWMap[V]) Version() VersionVector + type LWWRegister struct + func NewLWWRegister[T any](replica ReplicaID) *LWWRegister[T] + func (r *LWWRegister[T]) ApplyDelta(d Delta) (changed bool) + func (r *LWWRegister[T]) Equal(other Document) bool + func (r *LWWRegister[T]) ExtractDelta(since VersionVector) Delta + func (r *LWWRegister[T]) Merge(other Document) (changed bool) + func (r *LWWRegister[T]) Set(value T) + func (r *LWWRegister[T]) Timestamp() Timestamp + func (r *LWWRegister[T]) Value() T + func (r *LWWRegister[T]) Version() VersionVector + func (r *LWWRegister[T]) Writer() ReplicaID + type ReplicaID string + func (id ReplicaID) Compare(other ReplicaID) int + type Timestamp struct + func NewTimestamp(counter uint64, replica ReplicaID) Timestamp + func (ts Timestamp) Advance(seen Timestamp, replica ReplicaID) Timestamp + func (ts Timestamp) Compare(other Timestamp) int + func (ts Timestamp) Counter() uint64 + func (ts Timestamp) ReplicaID() ReplicaID + type VersionVector struct + func NewVersionVector(counters map[ReplicaID]uint64) VersionVector + func (v VersionVector) Clone() VersionVector + func (v VersionVector) Compare(other VersionVector) VersionVectorComparison + func (v VersionVector) Counters() map[ReplicaID]uint64 + func (v VersionVector) Equal(other VersionVector) bool + func (v VersionVector) Get(replica ReplicaID) uint64 + func (v VersionVector) Increment(replica ReplicaID) VersionVector + func (v VersionVector) Join(other VersionVector) VersionVector + func (v VersionVector) Merge(other VersionVector) VersionVector + func (v VersionVector) Since(other VersionVector) VersionVector + type VersionVectorComparison int + const VersionVectorConcurrent + const VersionVectorDominatedBy + const VersionVectorDominates + const VersionVectorEqual + func (c VersionVectorComparison) String() string