Documentation ¶
Overview ¶
Package output provides operations for command implementations to write information of various kinds.
Index ¶
- Variables
- func AllowOverwrite(ctx context.Context) bool
- func AllowRecoverableError(ctx context.Context) bool
- func Debugf(ctx context.Context, format string, args ...any) (int, error)
- func Errorf(ctx context.Context, format string, args ...any) (int, error)
- func Infof(ctx context.Context, format string, args ...any) (int, error)
- func NewContext(ctx context.Context, opts *Options) context.Context
- func Warningf(ctx context.Context, format string, args ...any) (int, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoContext is returned when FromContext cannot find an output.Options in the context. ErrNoContext = errors.New("no output context found") )
Functions ¶
func AllowOverwrite ¶
AllowOverwrite returns true if --overwrite is true.
func AllowRecoverableError ¶
AllowRecoverableError returns true if --keep_going is true.
func Errorf ¶
Errorf writes a formatted string with a newline to the Output modality, prefixed by an error message.
func NewContext ¶
NewContext returns ctx extended with opts added.
Types ¶
type Options ¶
type Options struct { Quiet bool Verbose bool UseLogs bool Overwrite bool KeepGoing bool Out io.Writer Err io.Writer }
Options controls the meaning of output modalities.
func FromContext ¶
FromContext returns the Options value in ctx if it exists.
Click to show internal directories.
Click to hide internal directories.