Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v1.4.30 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	From string   `json:"from"`
	To   string   `json:"to"`
	Type EdgeType `json:"type"`
}

type EdgeType

type EdgeType string
const (
	Manages    EdgeType = "manages"
	Exposes    EdgeType = "exposes"
	RoutesTo   EdgeType = "routes-to"
	Uses       EdgeType = "uses"
	Configures EdgeType = "configures"
	Scales     EdgeType = "scales"
)

type Graph

type Graph struct {
	Nodes     []Node         `json:"nodes"`
	Edges     []Edge         `json:"edges"`
	Omitted   map[string]int `json:"omitted"`
	Next      string         `json:"next,omitempty"`
	Truncated bool           `json:"truncated"`
	Sync      SyncStatus     `json:"sync"`
}

func Build

func Build(snapshot index.Snapshot, maxNodes int) Graph

Build constructs a bounded relationship graph without Kubernetes API reads.

func BuildComplete

func BuildComplete(snapshot index.Snapshot, maxEdges int) (Graph, bool)

BuildComplete constructs a graph without the paging-oriented node cap and returns false rather than truncating when the edge safety limit is exceeded.

func Neighborhood

func Neighborhood(graph Graph, ref Ref, hops, maxNodes int) Graph

Neighborhood returns an undirected BFS slice with the requested hop and node bounds.

type Node

type Node struct {
	ID        string `json:"id"`
	Kind      string `json:"kind"`
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name"`
	Health    string `json:"health,omitempty"`
	Group     string `json:"group"`
}

type Ref

type Ref struct {
	UID       string
	Kind      string
	Namespace string
	Name      string
}

type SyncStatus

type SyncStatus struct {
	State      string  `json:"state"`
	AgeSeconds float64 `json:"age_s"`
	Partial    bool    `json:"partial"`
}

Jump to

Keyboard shortcuts

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