core

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidirectionalEdgeErr

type BidirectionalEdgeErr struct {
	Src, Tgt string
}

func (BidirectionalEdgeErr) Error

func (e BidirectionalEdgeErr) Error() string

type CycleErr

type CycleErr struct {
	Src string
	Tgt string
}

func (CycleErr) Error

func (e CycleErr) Error() string

type Edge

type Edge struct {
	Key    string
	Source string
	Target string
}

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

func NewSoAGraph

func NewSoAGraph(logger *slog.Logger) *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(src, tgt string) error

func (*Graph) AddVertex

func (g *Graph) AddVertex(key string, label string, healthy bool) int

func (*Graph) ClearHealthyStatus

func (g *Graph) ClearHealthyStatus()

func (*Graph) Find

func (g *Graph) Find(key string) (Vertex, error)

func (*Graph) Path

func (g *Graph) Path(srcKey, tgtKey string) (Subgraph, error)

func (*Graph) SetVertexHealth

func (g *Graph) SetVertexHealth(key string, health bool) error

func (*Graph) StartHealthCheckLoop

func (g *Graph) StartHealthCheckLoop(ctx context.Context, checkInterval time.Duration)

func (*Graph) Stats added in v2.2.0

func (g *Graph) Stats() Stats

func (*Graph) VertexDependencies

func (g *Graph) VertexDependencies(key string, all bool) (Subgraph, error)

func (*Graph) VertexDependents

func (g *Graph) VertexDependents(key string, all bool) (Subgraph, error)

func (*Graph) VertexNeighbors

func (g *Graph) VertexNeighbors(key string) (Subgraph, error)

type Stats

type Stats struct {
	TotalVertices          int
	TotalUnhealthyVertices int
	TotalEdges             int
	TotalHealthyVertices   int

	UnhealthyVertices []Vertex
}

type Subgraph

type Subgraph struct {
	Vertices []Vertex
	Edges    []Edge
}

type Vertex

type Vertex struct {
	Key       string
	Label     string
	Healthy   bool
	LastCheck int64
}

type VertexNotFoundErr

type VertexNotFoundErr struct {
	Key string
}

func (VertexNotFoundErr) Error

func (e VertexNotFoundErr) Error() string

type VertexPathErr

type VertexPathErr struct {
	Src string
	Dst string
}

func (VertexPathErr) Error

func (e VertexPathErr) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL