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 ¶
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 { DetailedMode bool ShowExecutions bool ShowOnlyFailed bool ShowNamespaces bool WideMode bool }
Transformer can transform from []*InstallationTree to printable []PrintableTreeNodes with different transformation options.
func (Transformer) TransformToPrintableTrees ¶
func (t Transformer) TransformToPrintableTrees(installationTrees []*InstallationTree) ([]PrintableTreeNode, error)
TransformToPrintableTrees transform a []*InstallationTree to []PrintableTreeNodes for the Printer.