Documentation
¶
Index ¶
- Constants
- type DependencyNode
- type DependencyTree
- type Direction
- type GraphEdge
- type GraphIndexer
- func (gi *GraphIndexer) CheckLabelSelectorsForEntry(entry registry.ResourceEntry)
- func (gi *GraphIndexer) Name() string
- func (gi *GraphIndexer) OnAdd(entry registry.ResourceEntry, raw json.RawMessage)
- func (gi *GraphIndexer) OnDelete(entry registry.ResourceEntry)
- func (gi *GraphIndexer) OnUpdate(old, new_ registry.ResourceEntry, raw json.RawMessage)
- type GraphNode
- type RelationshipGraph
- func (g *RelationshipGraph) AddEdge(edge GraphEdge)
- func (g *RelationshipGraph) ClearDeclarationsForPlugin(pluginID string)
- func (g *RelationshipGraph) EdgesFrom(nodeKey string) []GraphEdge
- func (g *RelationshipGraph) EdgesTo(nodeKey string) []GraphEdge
- func (g *RelationshipGraph) GetDeclarations(resourceKey string) []resource.RelationshipDescriptor
- func (g *RelationshipGraph) GetDependencyTree(ref GraphNode, maxDepth int) (*DependencyTree, error)
- func (g *RelationshipGraph) GetRelated(ref GraphNode, direction Direction, relType *RelationshipType) ([]GraphEdge, error)
- func (g *RelationshipGraph) GetRelationshipChain(ref GraphNode, relType RelationshipType, maxDepth int) ([][]GraphEdge, error)
- func (g *RelationshipGraph) GetSelectorCache(nodeKey string) (map[string]string, bool)
- func (g *RelationshipGraph) RemoveEdgesForConnection(pluginID, connectionID string)
- func (g *RelationshipGraph) RemoveEdgesForNode(nodeKey string)
- func (g *RelationshipGraph) SetDeclarations(pluginID, resourceKey string, decls []resource.RelationshipDescriptor)
- func (g *RelationshipGraph) SetSelectorCache(nodeKey string, selector map[string]string)
- type RelationshipType
Constants ¶
const ( RelOwns = resource.RelOwns RelRunsOn = resource.RelRunsOn RelUses = resource.RelUses RelExposes = resource.RelExposes RelManages = resource.RelManages RelMemberOf = resource.RelMemberOf )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DependencyNode ¶
type DependencyNode struct {
Edge GraphEdge `json:"edge"`
Children []DependencyNode `json:"children"`
}
type DependencyTree ¶
type DependencyTree struct {
Root GraphNode `json:"root"`
Children []DependencyNode `json:"children"`
}
type GraphEdge ¶
type GraphEdge struct {
Source GraphNode `json:"source"`
Target GraphNode `json:"target"`
Type RelationshipType `json:"type"`
Label string `json:"label"`
}
type GraphIndexer ¶
type GraphIndexer struct {
// contains filtered or unexported fields
}
func NewGraphIndexer ¶
func NewGraphIndexer(graph *RelationshipGraph, store registry.RegistryStore) *GraphIndexer
func (*GraphIndexer) CheckLabelSelectorsForEntry ¶
func (gi *GraphIndexer) CheckLabelSelectorsForEntry(entry registry.ResourceEntry)
CheckLabelSelectorsForEntry checks if any cached selectors match the labels on a newly added/updated entry.
func (*GraphIndexer) Name ¶
func (gi *GraphIndexer) Name() string
func (*GraphIndexer) OnAdd ¶
func (gi *GraphIndexer) OnAdd(entry registry.ResourceEntry, raw json.RawMessage)
func (*GraphIndexer) OnDelete ¶
func (gi *GraphIndexer) OnDelete(entry registry.ResourceEntry)
func (*GraphIndexer) OnUpdate ¶
func (gi *GraphIndexer) OnUpdate(old, new_ registry.ResourceEntry, raw json.RawMessage)
type GraphNode ¶
type GraphNode struct {
PluginID string `json:"pluginId"`
ConnectionID string `json:"connectionId"`
ResourceKey string `json:"resourceKey"`
ID string `json:"id"`
Namespace string `json:"namespace,omitempty"`
}
GraphNode identifies a specific resource instance in the graph.
type RelationshipGraph ¶
type RelationshipGraph struct {
// contains filtered or unexported fields
}
func NewRelationshipGraph ¶
func NewRelationshipGraph() *RelationshipGraph
func (*RelationshipGraph) AddEdge ¶
func (g *RelationshipGraph) AddEdge(edge GraphEdge)
func (*RelationshipGraph) ClearDeclarationsForPlugin ¶
func (g *RelationshipGraph) ClearDeclarationsForPlugin(pluginID string)
func (*RelationshipGraph) EdgesFrom ¶
func (g *RelationshipGraph) EdgesFrom(nodeKey string) []GraphEdge
func (*RelationshipGraph) EdgesTo ¶
func (g *RelationshipGraph) EdgesTo(nodeKey string) []GraphEdge
func (*RelationshipGraph) GetDeclarations ¶
func (g *RelationshipGraph) GetDeclarations(resourceKey string) []resource.RelationshipDescriptor
GetDeclarations returns declarations for a resource key across all plugins.
func (*RelationshipGraph) GetDependencyTree ¶
func (g *RelationshipGraph) GetDependencyTree(ref GraphNode, maxDepth int) (*DependencyTree, error)
GetDependencyTree follows ALL outgoing edge types recursively from root. maxDepth is capped at 5 to prevent explosion.
func (*RelationshipGraph) GetRelated ¶
func (g *RelationshipGraph) GetRelated(ref GraphNode, direction Direction, relType *RelationshipType) ([]GraphEdge, error)
GetRelated returns edges connected to the given node, filtered by direction and type.
func (*RelationshipGraph) GetRelationshipChain ¶
func (g *RelationshipGraph) GetRelationshipChain(ref GraphNode, relType RelationshipType, maxDepth int) ([][]GraphEdge, error)
GetRelationshipChain follows edges of a specific type up to maxDepth hops. Returns edges organized by depth level. Uses BFS with visited-set cycle detection.
func (*RelationshipGraph) GetSelectorCache ¶
func (g *RelationshipGraph) GetSelectorCache(nodeKey string) (map[string]string, bool)
func (*RelationshipGraph) RemoveEdgesForConnection ¶
func (g *RelationshipGraph) RemoveEdgesForConnection(pluginID, connectionID string)
func (*RelationshipGraph) RemoveEdgesForNode ¶
func (g *RelationshipGraph) RemoveEdgesForNode(nodeKey string)
func (*RelationshipGraph) SetDeclarations ¶
func (g *RelationshipGraph) SetDeclarations(pluginID, resourceKey string, decls []resource.RelationshipDescriptor)
func (*RelationshipGraph) SetSelectorCache ¶
func (g *RelationshipGraph) SetSelectorCache(nodeKey string, selector map[string]string)
type RelationshipType ¶
type RelationshipType = resource.RelationshipType
RelationshipType re-exports from SDK for convenience.