cmdtree

package
v0.0.0-...-c7d747a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphStructures = []string{string(TreeStructurePackage)}

Functions

func NewCommand

func NewCommand(ctx context.Context, name string) *cobra.Command

Types

type TreeRunner

type TreeRunner struct {
	Command *cobra.Command
	Ctx     context.Context
}

TreeRunner contains the run function

func GetTreeRunner

func GetTreeRunner(ctx context.Context, name string) *TreeRunner

type TreeStructure

type TreeStructure string
const (
	// TreeStructurePackage configures TreeWriter to generate the tree structure off of the
	// Resources packages.
	TreeStructurePackage TreeStructure = "directory"
	// %q holds the package name
	PkgNameFormat = "Package %q"
)

type TreeWriter

type TreeWriter struct {
	Writer    io.Writer
	Root      string
	Fields    []TreeWriterField
	Structure TreeStructure
}

TreeWriter prints the package structured as a tree. TODO(pwittrock): test this package better. it is lower-risk since it is only used for printing rather than updating or editing.

func (TreeWriter) Write

func (p TreeWriter) Write(nodes []*yaml.RNode) error

Write writes the ascii tree to p.Writer

type TreeWriterField

type TreeWriterField struct {
	yaml.PathMatcher
	Name    string
	SubName string
}

TreeWriterField configures a Resource field to be included in the tree

Jump to

Keyboard shortcuts

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