graph

package
v0.9.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRuntimeFactory

func NewRuntimeFactory() cmdutil.Factory

func TraverseTopology

func TraverseTopology(lg *zap.SugaredLogger, f cmdutil.Factory) (*kgraph.Graph, error)

panics if run outside of a kubernetes environment

Types

type ScientificKubeEdge

type ScientificKubeEdge struct {
	F graph.Node
	T graph.Node
	// kubernetes label
	Label string
	// kubernetes relationship attributes
	Attributes map[string]string
}

ScientificKubeEdge implements gonum/graph.Edge

func (ScientificKubeEdge) From

func (s ScientificKubeEdge) From() graph.Node

func (ScientificKubeEdge) ReversedEdge

func (s ScientificKubeEdge) ReversedEdge() graph.Edge

func (ScientificKubeEdge) To

func (s ScientificKubeEdge) To() graph.Node

type ScientificKubeGraph

type ScientificKubeGraph struct {
	// we need to keep a copy of this in order to eventually
	// optimize storing / updating differences
	//nolint:allowunused
	KubernetesIdsToGonumIds map[types.UID]int64 `json:"kubernetesIdsToGonumIds,omitempty"`
	*simple.DirectedGraph   `json:"inline,omitempty"`
}

ScientificKubeGraph implements gonum/graph.Graph

func NewScientificKubeGraph

func NewScientificKubeGraph() *ScientificKubeGraph

func (*ScientificKubeGraph) FromKubectlGraph

func (s *ScientificKubeGraph) FromKubectlGraph(g *kgraph.Graph) error

FromKubectlGraph returns an error if we can't translate the kubectl-graph to a gonum graph

func (*ScientificKubeGraph) IsEmpty

func (s *ScientificKubeGraph) IsEmpty() bool

func (*ScientificKubeGraph) RenderDOT

func (s *ScientificKubeGraph) RenderDOT() ([]byte, error)

type ScientificKubeNode

type ScientificKubeNode struct {
	Id                int64 `json:"id"`
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}

implements gonum/graph.Node

func (*ScientificKubeNode) ID

func (s *ScientificKubeNode) ID() int64

Jump to

Keyboard shortcuts

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