tree

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintTrees

func PrintTrees(nodes []PrintableTreeNode) strings.Builder

PrintTrees turns the given PrintableTreeNodes into a formated tree as strings.Builder.

Types

type Collector

type Collector struct {
	K8sClient client.Client
}

Collector is responsible for collecting CR (installations, executions, deployItems) from a cluster using the K8sClient.

func (*Collector) CollectInstallationsInCluster

func (c *Collector) CollectInstallationsInCluster(name string, namespace string) ([]*InstallationTree, error)

CollectInstallationsInCluster collects a single installation (including all referenced executions and deployitems) or all installations if name is empty.

type DeployItemLeaf

type DeployItemLeaf struct {
	DeployItem *lsv1alpha1.DeployItem `json:"deployItem,omitempty"`
}

DeployItemLeaf contains a DeployItem.

type ExecutionTree

type ExecutionTree struct {
	DeployItems []*DeployItemLeaf     `json:"deployItems,omitempty"`
	Execution   *lsv1alpha1.Execution `json:"execution,omitempty"`
}

ExecutionTree contains the Execution and the references to all DeployItems.

type InstallationTree

type InstallationTree struct {
	SubInstallations []*InstallationTree      `json:"subInstallations,omitempty"`
	Execution        *ExecutionTree           `json:"execution,omitempty"`
	Installation     *lsv1alpha1.Installation `json:"installation,omitempty"`
}

InstallationTree contains the Installation and the references to Sub-Installations and the Execution.

type PrintableTreeNode

type PrintableTreeNode struct {
	Headline    string
	WideData    string // will be displayed in '-o wide' mode
	Description string
	Childs      []*PrintableTreeNode
}

PrintableTreeNode contains the structure for a printable tree.

type Transformer

type Transformer struct {
	// contains filtered or unexported fields
}

Transformer can transform from []*InstallationTree to printable []PrintableTreeNodes with different transformation options.

func NewTransformer added in v0.34.0

func NewTransformer(detailedMode, showOnlyFailed, showNamespaces, wideMode bool) *Transformer

func (*Transformer) TransformToPrintableTrees

func (t *Transformer) TransformToPrintableTrees(installationTrees []*InstallationTree) ([]PrintableTreeNode, error)

TransformToPrintableTrees transform a []*InstallationTree to []PrintableTreeNodes for the Printer.

Jump to

Keyboard shortcuts

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