Help us shape the future of Go! Take the 2026 Go Developer Survey

middleware

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ReleaseDir = "hack/release"

ReleaseDir is the path to the release directory base relative to the repo root.

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging(c *cli.Command)

ConfigureLogging sets up logging to both stdout and a file.

func LogPrettifier

func LogPrettifier(f *runtime.Frame) (string, string)

LogPrettifier formats logrus caller information as "pkg.Func():file:line".

func SummaryOutputDir

func SummaryOutputDir(repoRootDir string) string

SummaryOutputDir returns the base output directory for step summaries.

func WithLogging

func WithLogging(before cli.BeforeFunc) cli.BeforeFunc

WithLogging wraps a cli.BeforeFunc with automatic log file configuration derived from the command's full name (e.g. "release branch" -> "release-branch.log").

func WithSummary

func WithSummary(step string, action SummaryAction) cli.ActionFunc

WithSummary wraps a SummaryAction with timing, status, and summary file emission.

func WriteSummary

func WriteSummary(baseDir, key, step string, s StepSummary) error

WriteSummary writes a summary YAML file to <baseDir>/summary/<key>/<step>.yaml. key is a release version or stream identifier; step is the step name.

Types

type StepSummary

type StepSummary struct {
	Status    string         `yaml:"status"`
	Started   time.Time      `yaml:"started"`
	Completed time.Time      `yaml:"completed"`
	Outputs   map[string]any `yaml:"outputs,omitempty"`
}

StepSummary represents structured output for a release step. Written to <repoRoot>/hack/release/_output/summary/<key>/<step>.yaml, where <key> is a release version (e.g. v1.36.0) for release-* steps or a stream identifier (e.g. v1.36) for branch-* steps.

type SummaryAction

type SummaryAction func(context.Context, *cli.Command) (string, map[string]any, error)

SummaryAction is a command action that returns a key (version or stream), structured outputs, and an error.

Jump to

Keyboard shortcuts

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