cout

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cout provides verbosity-levelled, coloured console output.

Index

Constants

View Source
const (
	VerbositySilent = iota
	VerbosityJSON
	VerbosityQuiet
	VerbosityNormal
	VerbosityVerbose
)

Verbosity levels (ordered from least to most output)

Variables

Level controls the output verbosity. Set before any output calls.

Functions

func AddResult

func AddResult(pr int, service string, buildNumber int, url string)

AddResult collects a build result for JSON output

func Errorf added in v1.0.1

func Errorf(format string, args ...any)

Errorf prints an error to stderr in every mode except silent, so failures stay visible even when stdout is machine-readable (quiet/json) or suppressed.

func FlushJSON

func FlushJSON()

FlushJSON outputs collected results as a JSON array and resets the collector. An empty result set emits [] so JSON mode always produces valid JSON.

func Printf

func Printf(format string, args ...any)

Printf prints normal output with color support (suppressed in quiet, json, and silent modes)

func Println

func Println(args ...any)

Println prints normal output (suppressed in quiet, json, and silent modes)

func Quietf

func Quietf(format string, args ...any)

Quietf prints output only in quiet mode with color support. Use this for the minimal machine-readable output.

func Verbosef added in v0.9.1

func Verbosef(format string, args ...any)

Verbosef prints detailed output only when -v is set (suppressed at normal and below).

func Writer

func Writer() io.Writer

Writer returns the appropriate writer for normal output (os.Stdout or discard)

Types

type BuildResult

type BuildResult struct {
	PR          int    `json:"pr"`
	Service     string `json:"service"`
	BuildNumber int    `json:"build_number"`
	URL         string `json:"url"`
}

BuildResult represents a single triggered build for JSON output

Jump to

Keyboard shortcuts

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