tty

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decorator

type Decorator struct{}

func (*Decorator) AmpelBanner

func (d *Decorator) AmpelBanner(legend string) string

func (*Decorator) AssessmentToString

func (d *Decorator) AssessmentToString(a *papi.Assessment) string

func (*Decorator) Bold

func (d *Decorator) Bold(txt string) string

func (*Decorator) ControlsToString

func (d *Decorator) ControlsToString(result *papi.Result, checkID, def string) string

func (*Decorator) ErrorToString

func (d *Decorator) ErrorToString(err *papi.Error) string

func (*Decorator) StatusToDot

func (d *Decorator) StatusToDot(status string) string

func (*Decorator) SubjectToString

func (d *Decorator) SubjectToString(subject attestation.Subject, chain []*papi.ChainedSubject) string

func (*Decorator) TenetsToString

func (d *Decorator) TenetsToString(result *papi.Result) string

type Driver

type Driver struct {
	Decorator *Decorator
}

Driver renders Ampel results as ANSI-styled terminal tables using github.com/carabiner-dev/termtable. The tables auto-size to the attached terminal and clip overwide output to the screen.

func New

func New() *Driver

New returns the TTY driver, wired to the default Decorator.

func (*Driver) RenderResult

func (d *Driver) RenderResult(w io.Writer, result *papi.Result) error

RenderResult writes the 3-column single-result table to w.

func (*Driver) RenderResultGroup added in v1.1.0

func (d *Driver) RenderResultGroup(w io.Writer, rset *papi.ResultGroup) error

RenderResultGroup writes the 4-column policy-group table to w.

func (*Driver) RenderResultSet

func (d *Driver) RenderResultSet(w io.Writer, rset *papi.ResultSet) error

RenderResultSet writes the 4-column policy-set table to w.

Jump to

Keyboard shortcuts

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