cmdtree

package
v1.0.2-pre.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
	// PkgNameWithDepFormat formats a package name with its dependency type,
	PkgNameWithDepFormat = PkgNameFormat + " (%s)"

	// PkgTypeIndependent indicates a package with its own upstream source.
	PkgTypeIndependent = "independent"
	// PkgTypeDependent indicates a package without upstream (inherits from parent).
	PkgTypeDependent = "dependent"
)

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

type TreeWriter

type TreeWriter struct {
	Writer      io.Writer
	Root        string
	Fields      []TreeWriterField
	Structure   TreeStructure
	NonKRMFiles map[string][]string // root-relative dir → file basenames in that dir, or relative paths after roll-up from subdirs
}

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