graph

package
v0.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(element string, elements []string) bool

Contains returns true if a string is being contained in a list of strings

func GetPrettyString

func GetPrettyString(ugly string) string

GetPrettyString returns a string without dashes

func ToJSON

func ToJSON(v interface{}) string

ToJSON returns a json string

Types

type Builder

type Builder struct {
	Client    dynamic.Interface
	Namespace string
	Kind      string
	Name      string
	Out       io.Writer
	DotGraph  bool
	ObjData
}

Builder holds the information to build the graph

func NewBuilder

func NewBuilder(client dynamic.Interface, out io.Writer, dotGraph bool, namespace, kind, name string) *Builder

NewBuilder returns a new builder struct

func (*Builder) Build

func (b *Builder) Build() error

Build gets all the information required to build the graph

type Filter

type Filter struct{}

Filter holds the functions to filter the related objects

func NewFilter

func NewFilter() *Filter

NewFilter returns a new Filter struct

func (*Filter) FilterObj

func (f *Filter) FilterObj(obj unstructured.Unstructured, relatedObj unstructured.Unstructured) bool

FilterObj filters the related objects based on the obj and related obj kind

type ObjData

type ObjData struct {
	Obj             unstructured.Unstructured
	Hierarchy       string
	RelatedObjsData []ObjData
}

ObjData holds the object and related objects data

type Printer

type Printer struct {
	ObjData
	DotGraph bool
	Out      io.Writer
}

Printer holds the object data and graph type to print

func NewPrinter

func NewPrinter(objData ObjData, dotGraph bool, out io.Writer) *Printer

NewPrinter returns a new Printer struct

func (*Printer) Print

func (p *Printer) Print() (err error)

Print prints the tree or dot graph

Jump to

Keyboard shortcuts

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