display

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LineTreeFormat = TreeFormat{
	MiddleDrop: "├── ",
	LastDrop:   "└── ",
	SkipLine:   "│   ",
	Spacer:     "    ",
}

LineTreeFormat uses line drawing characters to format a tree

TreeRoot ├── First child # MiddleDrop = "├── " │ Skipped line # SkipLine = "│ " └── Last child # LastDrop = "└── " ....└── Only child # Spacer="....", LastDrop = "└── "

Functions

func Verbose

func Verbose(p *ImageTreePrinter)

Types

type ImageTreePrinter

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

func NewImageTreePrinter

func NewImageTreePrinter(opts ...PrintOpt) *ImageTreePrinter

func (*ImageTreePrinter) PrintImageTree

func (p *ImageTreePrinter) PrintImageTree(ctx context.Context, img images.Image, store content.InfoReaderProvider) error

PrintImageTree prints an image and all its sub elements

func (*ImageTreePrinter) PrintManifestTree

func (p *ImageTreePrinter) PrintManifestTree(ctx context.Context, desc ocispec.Descriptor, store content.InfoReaderProvider) error

PrintManifestTree prints a manifest and all its sub elements

type PrintOpt

type PrintOpt func(*ImageTreePrinter)

func WithFormat

func WithFormat(format TreeFormat) PrintOpt

func WithWriter

func WithWriter(w io.Writer) PrintOpt

type TreeFormat

type TreeFormat struct {
	MiddleDrop string
	LastDrop   string
	SkipLine   string
	Spacer     string
}

TreeFormat is used to format tree based output using 4 values. Each value must display with the same total width to format correctly.

MiddleDrop is used to show a child element which is not the last child LastDrop is used to show the last child element SkipLine is used for displaying data from a previous child before the next child Spacer is used to display child data for the last child

Jump to

Keyboard shortcuts

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