reporter

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MPL-2.0 Imports: 8 Imported by: 4

Documentation

Overview

Package reporter implements the console reporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOutputModeFlag added in v1.13.0

func NewOutputModeFlag() flags.PflagExtended[OutputMode]

NewOutputModeFlag returns a pflag.Value for the output mode.

Types

type Option added in v1.13.0

type Option func(*Reporter)

Option represents an option for configuring the Reporter.

func WithOutputMode added in v1.13.0

func WithOutputMode(mode OutputMode) Option

WithOutputMode returns an Option that sets the output mode of the Reporter.

type OutputMode added in v1.13.0

type OutputMode int32

OutputMode represents the output mode of the reporter.

const (
	// OutputModeAuto represents the automatic output mode, which detects if the output is a terminal.
	OutputModeAuto OutputMode = iota

	// OutputModePlain represents the plain output mode, which disables colorization and spinner.
	OutputModePlain
)

func (OutputMode) String added in v1.13.0

func (o OutputMode) String() string

String implements the fmt.Stringer interface for OutputMode.

type Reporter

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

Reporter is a console reporter with stderr output.

func New

func New(opts ...Option) *Reporter

New returns a console reporter with stderr output.

func (*Reporter) IsColorized added in v1.13.0

func (r *Reporter) IsColorized() bool

IsColorized returns true if the reporter is colorized.

func (*Reporter) Report

func (r *Reporter) Report(update Update)

Report reports an update to the reporter.

type Status

type Status int

Status represents the status of an Update.

const (
	// StatusError represents an error status.
	StatusError Status = iota
	// StatusRunning represents a running status.
	StatusRunning
	// StatusSucceeded represents a success status.
	StatusSucceeded
	// StatusSkip represents a skipped status.
	StatusSkip
)

type Update

type Update struct {
	Message string
	Status  Status
}

Update represents an update to be reported.

Jump to

Keyboard shortcuts

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