progress

package
v0.117.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package progress defines the transport-neutral event contract used by long-running WB operations. Engines never write terminal output directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index added in v0.52.0

func Index(value int) *int

Index returns a stable pointer for an optional zero-based event index.

func Report

func Report(reporter Reporter, event Event)

Report invokes reporter when configured.

Types

type Event

type Event struct {
	Operation  string
	Phase      string
	Repository string
	Detail     string
	State      State
	Completed  int
	Total      int
	Wave       int
	Layer      *int
}

Event is one progress observation. Completed and Total refer to repositories or releases; Wave and Layer identify ordered campaigns. Layer is a pointer because layer zero is meaningful and must remain distinguishable from an operation that has no layer.

type Reporter

type Reporter func(Event)

Reporter receives progress events. Engines may call a reporter concurrently, so implementations must be concurrency-safe and return promptly. A nil reporter disables reporting.

type State

type State string

State describes the lifecycle of one operation or repository phase.

const (
	Started   State = "started"
	Running   State = "running"
	Completed State = "completed"
	Failed    State = "failed"
	Waiting   State = "waiting"
)

Jump to

Keyboard shortcuts

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