reporter

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package rporter contains types and functions used to simplify reporting of information and errors detected by the metamodel tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.0.36

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

Builder contains the data and logic needed to create a new reporter. Don't create instances of this type directly, use the New function instead.

func New added in v0.0.36

func New() *Builder

New creates a builder that can then be used to configurer and create a reporter.

func (*Builder) Build added in v0.0.36

func (b *Builder) Build() (result *Reporter, err error)

Build uses the configuration stored in the builder to create a new reporter.

func (*Builder) Streams added in v0.0.36

func (b *Builder) Streams(out, err io.Writer) *Builder

Streams sets the streams that the reporter will use to write messages. If not specified it will use os.Stdout for information messages and os.Stderr for error messages.

type Reporter

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

Reporter is the reported used by the metamodel tools. It prints the messages to the standard output stream. Don't create instances directly, use the New function instead.

func (*Reporter) Errorf

func (r *Reporter) Errorf(format string, args ...interface{}) error

Errorf prints an error message with the given format and arguments. It also return an error containing the same information, which will be usually discarded, except when the caller needs to report the error and also return it.

func (*Reporter) Errors

func (r *Reporter) Errors() int

Errors returns the number of errors that have been reported via this reporter.

func (*Reporter) Infof

func (r *Reporter) Infof(format string, args ...interface{})

Infof prints an informative message with the given format and arguments.

func (*Reporter) Warnf added in v0.0.17

func (r *Reporter) Warnf(format string, args ...interface{})

Warnf prints an warning message with the given format and arguments.

Jump to

Keyboard shortcuts

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