template

package
v0.0.0-...-c28cba7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTemplateFlushing retrieves an error message when template flushing fails.
	ErrTemplateFlushing = "Template flushing error"

	// ErrTemplateWriting retrieves an error message when template writing fails.
	ErrTemplateWriting = "Template writing error"
)

Functions

This section is empty.

Types

type Plain

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

Plain structure for retrieving simple templates

func NewPlain

func NewPlain(content string) (*Plain, error)

NewPlain retrieves an instanceo of Plain template

func (*Plain) Flush

func (p *Plain) Flush(writer io.Writer) error

Flush writes the buffered data into writer output.

func (*Plain) Write

func (p *Plain) Write(data interface{}) error

Write writes the template data in the buffer

type Table

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

Table structure for retrieving formatte tables.

func NewTable

func NewTable(format string) (*Table, error)

NewTable retrives an instance of Table template.

func (*Table) Flush

func (t *Table) Flush(writer io.Writer) error

Flush writes the buffered data into writer output.

func (*Table) Write

func (t *Table) Write(data interface{}) error

Write writes the template data in the table writer

type Template

type Template interface {
	// Write writes the data.
	Write(data interface{}) error

	// Flush writes the data into writer output.
	Flush(writer io.Writer) error
}

Template is responsible for formatting CLI output

Jump to

Keyboard shortcuts

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