Documentation ¶
Index ¶
- type ILastWriterWinsGraph
- type ILastWriterWinsSet
- type ITimeSet
- type LastWriterWinsGraph
- func (g *LastWriterWinsGraph[T]) AddEdge(vertex1, vertex2 T) error
- func (g *LastWriterWinsGraph[T]) AddVertex(vertex T) error
- func (g *LastWriterWinsGraph[T]) DeleteEdge(vertex1, vertex2 T) error
- func (g *LastWriterWinsGraph[T]) DeleteVertex(vertex T) error
- func (g *LastWriterWinsGraph[T]) FindPath(vertex1, vertex2 T) ([]T, error)
- func (g *LastWriterWinsGraph[T]) HasEdge(vertex1, vertex2 T) bool
- func (g *LastWriterWinsGraph[T]) HasVertex(vertex T) bool
- func (g *LastWriterWinsGraph[T]) Merge(other ILastWriterWinsGraph[T]) error
- func (g *LastWriterWinsGraph[T]) VertexEdges(vertex T) ([]T, error)
- func (g *LastWriterWinsGraph[T]) Vertices() ([]T, error)
- type LastWriterWinsSet
- func (s *LastWriterWinsSet[T]) Add(value T, t time.Time) error
- func (s *LastWriterWinsSet[T]) Added() ITimeSet[T]
- func (s *LastWriterWinsSet[T]) Deleted() ITimeSet[T]
- func (s *LastWriterWinsSet[T]) Get() ([]T, error)
- func (s *LastWriterWinsSet[T]) Has(value T) bool
- func (s *LastWriterWinsSet[T]) Merge(other ILastWriterWinsSet[T]) error
- func (s *LastWriterWinsSet[T]) Remove(value T, t time.Time) error
- type TimeSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ILastWriterWinsGraph ¶
type ILastWriterWinsGraph[T comparable] interface { AddVertex(T) error Vertices() ([]T, error) DeleteVertex(T) error HasVertex(T) bool AddEdge(v1, v2 T) error DeleteEdge(v1, v2 T) error HasEdge(v1, v2 T) bool VertexEdges(v T) ([]T, error) FindPath(v1, v2 T) ([]T, error) Merge(ILastWriterWinsGraph[T]) error // contains filtered or unexported methods }
func NewLastWriterWinsGraph ¶
func NewLastWriterWinsGraph[T comparable]() ILastWriterWinsGraph[T]
type ILastWriterWinsSet ¶
type ILastWriterWinsSet[T comparable] interface { Add(T, time.Time) error Remove(T, time.Time) error Has(T) bool Get() ([]T, error) Merge(ILastWriterWinsSet[T]) error Added() ITimeSet[T] Deleted() ITimeSet[T] }
func NewLastWriterWinsSet ¶
func NewLastWriterWinsSet[T comparable]() ILastWriterWinsSet[T]
type ITimeSet ¶
type ITimeSet[T comparable] interface { Store(T, time.Time) error When(T) (time.Time, bool) Each(func(T, time.Time) error) error Size() int }
func NewTimeSet ¶
func NewTimeSet[T comparable]() ITimeSet[T]
type LastWriterWinsGraph ¶
type LastWriterWinsGraph[T comparable] struct { // contains filtered or unexported fields }
LastWriterWinsGraph is a structure for a graph with vertices and edges based on LWW sets
func (*LastWriterWinsGraph[T]) AddEdge ¶
func (g *LastWriterWinsGraph[T]) AddEdge(vertex1, vertex2 T) error
func (*LastWriterWinsGraph[T]) AddVertex ¶
func (g *LastWriterWinsGraph[T]) AddVertex(vertex T) error
func (*LastWriterWinsGraph[T]) DeleteEdge ¶
func (g *LastWriterWinsGraph[T]) DeleteEdge(vertex1, vertex2 T) error
func (*LastWriterWinsGraph[T]) DeleteVertex ¶
func (g *LastWriterWinsGraph[T]) DeleteVertex(vertex T) error
func (*LastWriterWinsGraph[T]) FindPath ¶
func (g *LastWriterWinsGraph[T]) FindPath(vertex1, vertex2 T) ([]T, error)
func (*LastWriterWinsGraph[T]) HasEdge ¶
func (g *LastWriterWinsGraph[T]) HasEdge(vertex1, vertex2 T) bool
func (*LastWriterWinsGraph[T]) HasVertex ¶
func (g *LastWriterWinsGraph[T]) HasVertex(vertex T) bool
func (*LastWriterWinsGraph[T]) Merge ¶
func (g *LastWriterWinsGraph[T]) Merge(other ILastWriterWinsGraph[T]) error
func (*LastWriterWinsGraph[T]) VertexEdges ¶
func (g *LastWriterWinsGraph[T]) VertexEdges(vertex T) ([]T, error)
func (*LastWriterWinsGraph[T]) Vertices ¶
func (g *LastWriterWinsGraph[T]) Vertices() ([]T, error)
type LastWriterWinsSet ¶
type LastWriterWinsSet[T comparable] struct { // contains filtered or unexported fields }
func (*LastWriterWinsSet[T]) Added ¶
func (s *LastWriterWinsSet[T]) Added() ITimeSet[T]
func (*LastWriterWinsSet[T]) Deleted ¶
func (s *LastWriterWinsSet[T]) Deleted() ITimeSet[T]
func (*LastWriterWinsSet[T]) Get ¶
func (s *LastWriterWinsSet[T]) Get() ([]T, error)
Get returns set content
func (*LastWriterWinsSet[T]) Has ¶
func (s *LastWriterWinsSet[T]) Has(value T) bool
func (*LastWriterWinsSet[T]) Merge ¶
func (s *LastWriterWinsSet[T]) Merge(other ILastWriterWinsSet[T]) error
Merge additions and deletions from other LastWriterWinsSet into current set
type TimeSet ¶
type TimeSet[T comparable] struct { Records map[T]time.Time `json:"records"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.