reporter

package
v0.0.0-...-4e386bd Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default is the default reporter.
	Default = New()
)

Functions

This section is empty.

Types

type Nop

type Nop struct{}

Nop is a no-op reporter.

func (Nop) Header

func (n Nop) Header(string)

Header implements Reporter#Header.

func (Nop) Headerf

func (n Nop) Headerf(format string, a ...interface{})

Headerf implements Reporter#Headerf.

func (Nop) Report

func (n Nop) Report(format string)

Report implements Reporter#Report.

func (Nop) Reportf

func (n Nop) Reportf(format string, a ...interface{})

Reportf implements Reporter#Reportf.

type Reporter

type Reporter interface {
	// Header prints a header.
	Header(string)
	// Header prints a header from a formatted string.
	Headerf(format string, a ...interface{})
	// Report creates report output.
	Report(format string)
	// Reportf creates formatted report output.
	Reportf(format string, a ...interface{})
}

Reporter reports information to sheaf users.

type Std

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

Std is the standard reporter.

func New

func New(options ...StdOption) *Std

New creates an instance of Std.

func (Std) Header

func (r Std) Header(text string)

Header prints a header.

func (Std) Headerf

func (r Std) Headerf(format string, a ...interface{})

Headerf prints a formatted header.

func (Std) Report

func (r Std) Report(text string)

Report prints a report. Reports are indented.

func (Std) Reportf

func (r Std) Reportf(format string, a ...interface{})

Reportf prints a formatted report. Reports are indented.

type StdOption

type StdOption func(Std) Std

StdOption is a functional option for configuring Std.

func WithWriter

func WithWriter(w io.Writer) StdOption

WithWriter sets the writer.

Jump to

Keyboard shortcuts

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