Versions in this module Expand all Collapse all v0 v0.1.3 Oct 3, 2023 v0.1.2 Oct 3, 2023 Changes in this version + const PrefixChildConflictStorage + const PrefixConflictMemberStorage + const PrefixConflictStorage + type ChildConflict struct + func NewChildConflict(parentConflictID, childConflictID ConflictID) *ChildConflict[ConflictID] + func (c *ChildConflict[ConflictID]) ChildConflictID() (childConflictID ConflictID) + func (c *ChildConflict[ConflictID]) ParentConflictID() (parentConflictID ConflictID) + type Conflict struct + func NewConflict(id ConflictID, parents *set.AdvancedSet[ConflictID], ...) (new *Conflict[ConflictID, ConflictSetID]) + func (c *Conflict[ConflictID, ConflictSetID]) ConfirmationState() (confirmationState confirmation.State) + func (c *Conflict[ConflictID, ConflictSetID]) ConflictSetIDs() (conflictSetIDs *set.AdvancedSet[ConflictSetID]) + func (c *Conflict[ConflictID, ConflictSetID]) Parents() (parents *set.AdvancedSet[ConflictID]) + func (c *Conflict[ConflictID, ConflictSetID]) SetParents(parents *set.AdvancedSet[ConflictID]) + type ConflictAcceptedEvent struct + ID ConflictID + type ConflictConflictsUpdatedEvent struct + ConflictID ConflictID + NewConflictIDs *set.AdvancedSet[ConflictingResourceID] + type ConflictCreatedEvent struct + ConflictingResourceIDs *set.AdvancedSet[ConflictingResourceID] + ID ConflictID + ParentConflictIDs *set.AdvancedSet[ConflictID] + type ConflictDAG struct + Events *Events[ConflictIDType, ResourceIDType] + Storage *Storage[ConflictIDType, ResourceIDType] + Utils *Utils[ConflictIDType, ResourceIDType] + func New(options ...Option) (new *ConflictDAG[ConflictIDType, ResourceIDType]) + func (b *ConflictDAG[ConflictID, ConflictingResourceID]) ConfirmationState(conflictIDs *set.AdvancedSet[ConflictID]) (confirmationState confirmation.State) + func (b *ConflictDAG[ConflictID, ConflictingResourceID]) SetConflictAccepted(conflictID ConflictID) (modified bool) + func (b *ConflictDAG[ConflictID, ConflictingResourceID]) Shutdown() + func (b *ConflictDAG[ConflictIDType, ConflictingResourceID]) UnconfirmedConflicts(conflictIDs *set.AdvancedSet[ConflictIDType]) (pendingConflictIDs *set.AdvancedSet[ConflictIDType]) + func (b *ConflictDAG[ConflictIDType, ResourceIDType]) CreateConflict(id ConflictIDType, parents *set.AdvancedSet[ConflictIDType], ...) (created bool) + func (b *ConflictDAG[ConflictIDType, ResourceIDType]) UpdateConflictParents(id ConflictIDType, removedConflictIDs *set.AdvancedSet[ConflictIDType], ...) (updated bool) + func (b *ConflictDAG[ConflictIDType, ResourceIDType]) UpdateConflictingResources(id ConflictIDType, conflictingResourceIDs *set.AdvancedSet[ResourceIDType]) (updated bool) + type ConflictMember struct + func NewConflictMember(conflictSetID ConflictSetID, conflictID ConflictID) (new *ConflictMember[ConflictSetID, ConflictID]) + func (c *ConflictMember[ConflictSetID, ConflictID]) ConflictID() (conflictID ConflictID) + func (c *ConflictMember[ConflictSetID, ConflictID]) ConflictSetID() (conflictSetID ConflictSetID) + type ConflictParentsUpdatedEvent struct + AddedConflict ConflictID + ConflictID ConflictID + ParentsConflictIDs *set.AdvancedSet[ConflictID] + RemovedConflicts *set.AdvancedSet[ConflictID] + type ConflictRejectedEvent struct + ID ConflictID + type Events struct + ConflictAccepted *event.Event[*ConflictAcceptedEvent[ConflictID]] + ConflictConflictsUpdated *event.Event[*ConflictConflictsUpdatedEvent[ConflictID, ConflictingResourceID]] + ConflictCreated *event.Event[*ConflictCreatedEvent[ConflictID, ConflictingResourceID]] + ConflictParentsUpdated *event.Event[*ConflictParentsUpdatedEvent[ConflictID, ConflictingResourceID]] + ConflictRejected *event.Event[*ConflictRejectedEvent[ConflictID]] + type Option func(*options) + func WithCacheTimeProvider(cacheTimeProvider *database.CacheTimeProvider) Option + func WithChildConflictCacheTime(childConflictCacheTime time.Duration) Option + func WithConflictCacheTime(conflictCacheTime time.Duration) Option + func WithConflictMemberCacheTime(conflictMemberCacheTime time.Duration) Option + func WithMergeToMaster(mergeToMaster bool) Option + func WithStore(store kvstore.KVStore) Option + type Storage struct + func (s *Storage[ConflictID, ConflictSetID]) CachedChildConflict(parentConflictID, childConflictID ConflictID, ...) *objectstorage.CachedObject[*ChildConflict[ConflictID]] + func (s *Storage[ConflictID, ConflictSetID]) CachedChildConflicts(conflictID ConflictID) (cachedChildConflicts objectstorage.CachedObjects[*ChildConflict[ConflictID]]) + func (s *Storage[ConflictID, ConflictSetID]) CachedConflict(conflictID ConflictID, ...) (...) + func (s *Storage[ConflictID, ConflictSetID]) CachedConflictMember(conflictSetID ConflictSetID, conflictID ConflictID, ...) *objectstorage.CachedObject[*ConflictMember[ConflictSetID, ConflictID]] + func (s *Storage[ConflictID, ConflictSetID]) CachedConflictMembers(conflictID ConflictSetID) (...) + func (s *Storage[ConflictID, ConflictSetID]) Prune() (err error) + func (s *Storage[ConflictID, ConflictSetID]) Shutdown() + type Utils struct + func (u *Utils[ConflictID, ConflictSetID]) ForEachChildConflictID(conflictID ConflictID, callback func(childConflictID ConflictID)) + func (u *Utils[ConflictID, ConflictSetID]) ForEachConflict(consumer func(conflict *Conflict[ConflictID, ConflictSetID])) + func (u *Utils[ConflictID, ConflictSetID]) ForEachConflictingConflictID(conflictID ConflictID, callback func(conflictingConflictID ConflictID) bool) + func (u *Utils[ConflictID, ConflictSetID]) ForEachConnectedConflictingConflictID(conflictID ConflictID, callback func(conflictingConflictID ConflictID))