printer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPrinter

type JSONPrinter struct {
}

JSONPrinter is a JSON printer (the default one)

func NewPrinterJSON

func NewPrinterJSON(options Options) (*JSONPrinter, error)

NewPrinterJSON returns a JSON printer

func (*JSONPrinter) PrintReleases

func (p *JSONPrinter) PrintReleases(rr []gh.Release) error

PrintReleases displays a list of releases in JSON format

type Options

type Options map[string]interface{}

Options contains printer-specific options

type PlainPrinter

type PlainPrinter struct {
	// contains filtered or unexported fields
}

PlainPrinter is a plain text printer (the default one)

func NewPrinterPlain

func NewPrinterPlain(options Options) (*PlainPrinter, error)

NewPrinterPlain returns a plaintext printer

func (*PlainPrinter) PrintReleases

func (p *PlainPrinter) PrintReleases(rr []gh.Release) error

PrintReleases displays a list of releases to the standard output

type Printer

type Printer interface {
	// PrintReleases receives a list of releases,
	// formats it and prints it to stdout.
	PrintReleases([]gh.Release) error
}

Printer is an interface used to print objects.

func NewPrinter

func NewPrinter(printerName string, o Options) (Printer, error)

NewPrinter returns a printer of the requested kind

type TemplatePrinter

type TemplatePrinter struct {
	// contains filtered or unexported fields
}

TemplatePrinter represents a Template printer

func NewPrinterTemplate

func NewPrinterTemplate(options Options) (*TemplatePrinter, error)

NewPrinterTemplate returns a Template printer For TemplatePrinter, the options parameter contains the template string. The "color_mode" option defines the color behaviour: it can be "auto" (default), "on" (forced), "off" (disabled).

func (*TemplatePrinter) PrintReleases

func (p *TemplatePrinter) PrintReleases(rr []gh.Release) error

PrintReleases displays a list of releases to the standard output

type YAMLPrinter

type YAMLPrinter struct {
}

YAMLPrinter is a YAML printer (the default one)

func NewPrinterYAML

func NewPrinterYAML(options Options) (*YAMLPrinter, error)

NewPrinterYAML returns a YAML printer

func (*YAMLPrinter) PrintReleases

func (p *YAMLPrinter) PrintReleases(rr []gh.Release) error

PrintReleases displays a list of releases in YAML format

Jump to

Keyboard shortcuts

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