render

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: 13 Imported by: 0

README

Results Render Drivers

This directory contains drivers for the results renderer. More drivers can be added by implementing the render.Driver interface and registering them in the reader drivers array.

Currently AMPEL supports the following drivers:

  • attester: Generates an AMPEL ResultSet attestation.
  • tty: The driver that displays results in the terminal screen.
  • html: Renders evaluation results as HTML.
  • markdown: Outputs the evaluation results in markdown.
  • vsa: Renders the results set in a Verification Summary attestation.

The tty, html and markdown drivers share code through the TableBuilder interface. The results output is handled by a central logic core that builds a main table and delegates to a decorator to handle the all the format-specific nuances.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Formats added in v1.3.4

func Formats() []string

Formats returns the names of the registered rendering drivers

func LoadDefaultDrivers

func LoadDefaultDrivers()

func RegisterDriver

func RegisterDriver(t string, driver Driver)

func UnregisterDriver

func UnregisterDriver(t string, driver Driver)

Types

type Driver

type Driver interface {
	RenderResultSet(w io.Writer, status *papi.ResultSet) error
	RenderResult(w io.Writer, status *papi.Result) error
	RenderResultGroup(w io.Writer, status *papi.ResultGroup) error
}

func GetDriverBytType

func GetDriverBytType(t string) Driver

type Engine

type Engine struct {
	Driver Driver
}

func NewEngine

func NewEngine() *Engine

func (*Engine) RenderResult

func (e *Engine) RenderResult(w io.Writer, result *papi.Result) error

RenderResult calls the method of the same name of the configured driver

func (*Engine) RenderResultSet

func (e *Engine) RenderResultSet(w io.Writer, rset *papi.ResultSet) error

RenderResultSet calls the method of the same name of the configured driver

func (*Engine) SetDriver

func (e *Engine) SetDriver(format string) error

SetDriver sets the ourput driver format

Jump to

Keyboard shortcuts

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