Documentation
¶
Index ¶
- Constants
- func MustAccessObject[T any](node *Node, concreteObj T) T
- type Builder
- func (b *Builder) Build() (*Graph, error)
- func (b *Builder) StartFrom(sources []*unstructured.Unstructured) *Builder
- func (b *Builder) UseRelationship(relation *Relation) *Builder
- func (b *Builder) UseRelationships(relations []*Relation) *Builder
- func (b *Builder) WithMaxDepth(maxDepth int) *Builder
- type Graph
- func (g *Graph) AddEdge(from *Node, to *Node, relation *Relation)
- func (g *Graph) AddNode(node *Node)
- func (g *Graph) DeleteNode(node *Node)
- func (g *Graph) DeleteNodeUsingGKNN(nodeGKNN common.GKNN)
- func (g *Graph) HasNode(nodeGKNN common.GKNN) bool
- func (g *Graph) RemoveEdge(from *Node, to *Node, relation *Relation)
- func (g *Graph) RemoveMetadata(category string)
- type NeighborFunc
- type Node
- type Relation
Constants ¶
View Source
const (
DefaultGraphMaxDepth = 3
)
Variables ¶
This section is empty.
Functions ¶
func MustAccessObject ¶
Types ¶
type Builder ¶
type Builder struct { Sources []*unstructured.Unstructured Relations []*Relation Fetcher common.GroupKindFetcher MaxDepth int }
func NewBuilder ¶
func NewBuilder(fetcher common.GroupKindFetcher) *Builder
func (*Builder) StartFrom ¶
func (b *Builder) StartFrom(sources []*unstructured.Unstructured) *Builder
func (*Builder) UseRelationship ¶
func (*Builder) UseRelationships ¶
func (*Builder) WithMaxDepth ¶
type Graph ¶
type Graph struct { Nodes map[schema.GroupKind]map[types.NamespacedName]*Node Sources []*Node // MaxDepth represents the value of the maximum depth parameter used while // performing the BFS from Source nodes. Note that terminal nodes can have a // depth equal to MaxDepth+1. Any validations that need to happen should be // done for nodes <= MaxDepth. This ensures that any external references // from nodes <= MaxDepth can be validated. MaxDepth int Relations []*Relation }
func (*Graph) DeleteNode ¶
func (*Graph) DeleteNodeUsingGKNN ¶
func (*Graph) RemoveMetadata ¶
type NeighborFunc ¶
type NeighborFunc func(*unstructured.Unstructured) []common.GKNN
Click to show internal directories.
Click to hide internal directories.