Version: v0.7.0 Latest Latest

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

Go to latest
Published: May 17, 2020 License: Apache-2.0 Imports: 18 Imported by: 0




This section is empty.


This section is empty.



type GraphBuilder

type GraphBuilder interface {
	BuildGraph(string, string, string) (*Node, []*unstructured.Unstructured, error)

type GraphPrinter

type GraphPrinter struct {
	// contains filtered or unexported fields

GraphPrinter is able to print graph definition in Graphviz dot format.

func NewGraphPrinter

func NewGraphPrinter() *GraphPrinter

NewGraphPrinter returns a GraphPrinter

func (*GraphPrinter) Print

func (p *GraphPrinter) Print(nodes []*Node) error

Print prints graph definition in Graphviz dot format for a given root node.

type KubeGraphBuilder

type KubeGraphBuilder struct {
	// contains filtered or unexported fields

KubeGraphBuilder enables building graphs between kubernetes objects with the relations defined by objects.

func NewKubeGraphBuilder

func NewKubeGraphBuilder(client dynamic.Interface, restMapper meta.RESTMapper) *KubeGraphBuilder

NewKubeGraphBuilder returns a KubeGraphBuilder ready for building graphs.

func (*KubeGraphBuilder) BuildGraph

func (g *KubeGraphBuilder) BuildGraph(name, namespace, groupRes string) (root *Node, traversed []*Node, err error)

BuildGraph builds a graphs for the object, whose name, namespace and groupRes provided as input. This method returns the root node as well as the traversed array of nodes.

type Node

type Node struct {
	Instance *unstructured.Unstructured
	GVR      schema.GroupVersionResource
	Relateds []*Node
	State    NodeState

func NewNode

func NewNode(res schema.GroupVersionResource, instance *unstructured.Unstructured) *Node

func (*Node) GetId

func (n *Node) GetId() string

func (*Node) IsFetched

func (n *Node) IsFetched() bool

type NodeState

type NodeState string
const (
	NodeStateUnknown  NodeState = ""
	NodeStateMissing  NodeState = "Missing"
	NodeStateReady    NodeState = "Ready"
	NodeStateNotReady NodeState = "NotReady"

type Printer

type Printer interface {
	Print([]*Node) error

type SimplePrinter

type SimplePrinter struct {
	// contains filtered or unexported fields

SimplePrinter is able to print tabbed overview and details.

func NewSimplePrinter

func NewSimplePrinter() *SimplePrinter

NewSimplePrinter returns a SimplePrinter

func (*SimplePrinter) Print

func (p *SimplePrinter) Print(nodes []*Node) error

Prints prints tabbed overview and details in order for a given array of nodes.

Jump to

Keyboard shortcuts

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