tty

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 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

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