Versions in this module Expand all Collapse all v0 v0.8.0 Nov 20, 2022 Changes in this version + func ClockLoader(defs ...Definition) repository.ClockLoader + func Fetch(def Definition, repo repository.Repo, remote string) (string, error) + func IdOperation(op Operation, base *OpBase) entity.Id + func ListLocalIds(def Definition, repo repository.RepoData) ([]entity.Id, error) + func MergeAll(def Definition, repo repository.ClockedRepo, resolvers entity.Resolvers, ...) <-chan entity.MergeResult + func Pull(def Definition, repo repository.ClockedRepo, resolvers entity.Resolvers, ...) error + func Push(def Definition, repo repository.Repo, remote string) (string, error) + func ReadAll(def Definition, repo repository.ClockedRepo, resolvers entity.Resolvers) <-chan StreamedEntity + func ReadAllClocksNoCheck(def Definition, repo repository.ClockedRepo) error + func Remove(def Definition, repo repository.ClockedRepo, id entity.Id) error + func SerializeRoundTripTest(t *testing.T, unmarshaler OperationUnmarshaler, ...) + type Definition struct + FormatVersion uint + Namespace string + OperationUnmarshaler OperationUnmarshaler + Typename string + type Entity struct + func New(definition Definition) *Entity + func Read(def Definition, repo repository.ClockedRepo, resolvers entity.Resolvers, ...) (*Entity, error) + func (e *Entity) Append(op Operation) + func (e *Entity) Commit(repo repository.ClockedRepo) error + func (e *Entity) CommitAsNeeded(repo repository.ClockedRepo) error + func (e *Entity) CreateLamportTime() lamport.Time + func (e *Entity) EditLamportTime() lamport.Time + func (e *Entity) FirstOp() Operation + func (e *Entity) Id() entity.Id + func (e *Entity) LastOp() Operation + func (e *Entity) NeedCommit() bool + func (e *Entity) Operations() []Operation + func (e *Entity) Validate() error + type Interface interface + Append func(op OpT) + Commit func(repo repository.ClockedRepo) error + Compile func() SnapT + CreateLamportTime func() lamport.Time + EditLamportTime func() lamport.Time + FirstOp func() OpT + LastOp func() OpT + NeedCommit func() bool + Operations func() []OpT + Validate func() error + type NoOpOperation struct + func NewNoOpOp(opType OperationType, author identity.Interface, unixTime int64) *NoOpOperation[SnapT] + func (op *NoOpOperation[SnapT]) Apply(snapshot SnapT) + func (op *NoOpOperation[SnapT]) DoesntChangeSnapshot() + func (op *NoOpOperation[SnapT]) Id() entity.Id + func (op *NoOpOperation[SnapT]) Validate() error + type OpBase struct + Metadata map[string]string + Nonce []byte + OperationType OperationType + UnixTime int64 + func NewOpBase(opType OperationType, author identity.Interface, unixTime int64) OpBase + func (base *OpBase) AllMetadata() map[string]string + func (base *OpBase) Author() identity.Interface + func (base *OpBase) GetMetadata(key string) (string, bool) + func (base *OpBase) IdIsSet() bool + func (base *OpBase) IsAuthored() + func (base *OpBase) SetMetadata(key string, value string) + func (base *OpBase) Time() time.Time + func (base *OpBase) Type() OperationType + func (base *OpBase) Validate(op Operation, opType OperationType) error + type Operation interface + AllMetadata func() map[string]string + Author func() identity.Interface + GetMetadata func(key string) (string, bool) + Id func() entity.Id + SetMetadata func(key string, value string) + Time func() time.Time + Type func() OperationType + Validate func() error + type OperationDoesntChangeSnapshot interface + DoesntChangeSnapshot func() + type OperationType int + type OperationUnmarshaler func(raw json.RawMessage, resolver entity.Resolvers) (Operation, error) + type OperationWithFiles interface + GetFiles func() []repository.Hash + type PGPKeyring []*identity.Key + func (pk PGPKeyring) DecryptionKeys() []openpgp.Key + func (pk PGPKeyring) KeysById(id uint64) []openpgp.Key + func (pk PGPKeyring) KeysByIdUsage(id uint64, requiredUsage byte) []openpgp.Key + type SetMetadataOperation struct + NewMetadata map[string]string + Target entity.Id + func NewSetMetadataOp(opType OperationType, author identity.Interface, unixTime int64, ...) *SetMetadataOperation[SnapT] + func (op *SetMetadataOperation[SnapT]) Apply(snapshot SnapT) + func (op *SetMetadataOperation[SnapT]) DoesntChangeSnapshot() + func (op *SetMetadataOperation[SnapT]) Id() entity.Id + func (op *SetMetadataOperation[SnapT]) Validate() error + type Snapshot interface + AllOperations func() []Operation + type StreamedEntity struct + Entity *Entity + Err error