human

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowEverything

func ShowEverything(string, Printable) bool

ShowEverything shows all nodes

func ShowOnlyChanged

func ShowOnlyChanged(id string, value Printable) bool

ShowOnlyChanged filters nodes to show only changed nodes

Types

type FilterFunc

type FilterFunc func(id string, value Printable) bool

FilterFunc is used to filter out nodes which shouldn't be printed. The func should return `true` if the node is to be printed.

func AndFilter

func AndFilter(a, b FilterFunc) FilterFunc

AndFilter chains FilterFuncs together

func HideByKind

func HideByKind(types ...string) FilterFunc

HideByKind hides certain ID types in the graph. So for example if you want to hide all params, specify `param` as a type to this func. This uses the ID functions in the graph module.

type Printable

type Printable interface {
	Changes() map[string]resource.Diff
	Messages() []string
	HasChanges() bool
	Error() error
	Warning() string
}

Printable defines the methods needed to print with this printer

type Printer

type Printer struct {
	Color  bool // color output
	Filter FilterFunc
}

Printer for human-readable output

func New

func New() *Printer

New returns a base version of Printer

func NewFiltered

func NewFiltered(f FilterFunc) *Printer

NewFiltered returns a version of Printer that will filter according to the specified func

func (*Printer) DrawNode

func (p *Printer) DrawNode(g *graph.Graph, id string) (pp.Renderable, error)

DrawNode containing a result

func (*Printer) FinishPP

func (p *Printer) FinishPP(g *graph.Graph) (pp.Renderable, error)

FinishPP provides summary statistics about the printed graph

func (*Printer) InitColors

func (p *Printer) InitColors()

InitColors initializes the colors used by the human printer

func (*Printer) StartPP

func (p *Printer) StartPP(g *graph.Graph) (pp.Renderable, error)

StartPP does nothing, but is required to satisfy the GraphPrinter interface

Jump to

Keyboard shortcuts

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