output

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package output provides an interface for showing test results in different formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Output

type Output struct {
	OutputType Type
	// contains filtered or unexported fields
}

func NewOutput

func NewOutput(o string, w io.Writer) *Output

NewOutput returns a new output with the proper output format for the selected output type

func (*Output) IsJson

func (o *Output) IsJson() bool

func (*Output) Message

func (o *Output) Message(key string) string

Message predefined messages that might have different types depending on the output type. All message in catalogs, where the text in the message is used as a key to get the corresponding text.

func (*Output) Printf

func (o *Output) Printf(format string, a ...interface{}) error

func (*Output) Println

func (o *Output) Println(format string, a ...interface{}) error

func (*Output) RawPrint

func (o *Output) RawPrint(s string)

type Type

type Type string

Type is a string representing the types of output this application has. Each output type will be used for printing in a different way, compatible with the type they represent.

const (
	Normal Type = "normal"
	Quiet  Type = "quiet"
	GitHub Type = "github"
	JSON   Type = "json"
	Plain  Type = "plain" // when people (or terminals) don't want/support emojis
)

func ValidTypes

func ValidTypes() []Type

ValidTypes returns an array of the valid output types.

Jump to

Keyboard shortcuts

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