printer

package
v0.0.0-...-300ac43 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReportTemplate = template.Must(template.New("report").Parse(`# Summary
Total time: {{.TotalTime}}
Trace: {{.Trace}}

# Bandwidth
{{.BandwidthTable}}
# Bitswap
{{.BitswapTable}}`))
)

Functions

This section is empty.

Types

type OutputType

type OutputType string
var (
	OutputAuto  OutputType = "auto"
	OutputTable OutputType = "table"
	OutputID    OutputType = "id"
	OutputUnix  OutputType = "unix"
	OutputJSON  OutputType = "json"
)

type Printer

type Printer interface {
	Print(v interface{}) error
}

func GetPrinter

func GetPrinter(output, auto OutputType) (Printer, error)

func NewIDPrinter

func NewIDPrinter() Printer

func NewJSONPrinter

func NewJSONPrinter() Printer

func NewTablePrinter

func NewTablePrinter() Printer

func NewUnixPrinter

func NewUnixPrinter() Printer

type ReportData

type ReportData struct {
	TotalTime      string
	Trace          string
	BandwidthTable string
	BitswapTable   string
}

Jump to

Keyboard shortcuts

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