printers

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JSON = Register("json", NewJSONPrinter())
)
View Source
var (
	Text = Register("text", NewTextPrinter())
)
View Source
var (
	YAML = Register("yaml", NewYAMLPrinter())
)

Functions

func List

func List() []string

Types

type JSONPrinter

type JSONPrinter struct{}

func NewJSONPrinter

func NewJSONPrinter() *JSONPrinter

func (*JSONPrinter) Print

func (p *JSONPrinter) Print(w io.Writer, params *PrintParameters) error

type PrintParameters

type PrintParameters struct {
	Image    string
	Tags     []string
	WithName bool
}

type Printer

type Printer interface {
	Print(w io.Writer, params *PrintParameters) error
}

func Get

func Get(name string) (Printer, error)

func Register

func Register(name string, printer Printer) Printer

type TextPrinter

type TextPrinter struct{}

func NewTextPrinter

func NewTextPrinter() *TextPrinter

func (*TextPrinter) Print

func (p *TextPrinter) Print(w io.Writer, params *PrintParameters) error

type YAMLPrinter

type YAMLPrinter struct{}

func NewYAMLPrinter

func NewYAMLPrinter() *YAMLPrinter

func (*YAMLPrinter) Print

func (p *YAMLPrinter) Print(w io.Writer, params *PrintParameters) error

Jump to

Keyboard shortcuts

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