call

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package call provides batching primitives for executing repository-scoped work concurrently with shared cancellation and output semantics.

Command packages typically execute Do(...) with a Func implementation to apply a unit of work across a batch of repositories; output for each repository is streamed through the configured output.Channel.

When a workflow needs multiple sequential steps, Wrap(...) combines several Func values into one atomically-callable implementation.

The Exec helper creates a Func for command execution, including stdout/stderr streaming and exit-status error handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(cmd *cobra.Command, repos []string, callFunc Func, handler ...output.Handler) error

Do executes the provided Func on each repository, operating asynchronously by default with configurable concurrency limits. Repository aliases are also expanded here to allow for configurable repository grouping. Output formatting can be fully customized by optionally providing one or more OutputHandler functions. Each repository will also be cloned first if it is missing from the local file system.

Types

type Error added in v1.0.0

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

Error wraps runtime errors that occur during subprocess execution.

func (*Error) Error added in v1.0.0

func (e *Error) Error() string

Error implements the error interface.

func (*Error) Is added in v1.0.0

func (e *Error) Is(target error) bool

Is allows errors.Is to identify this as a call.Error.

func (*Error) Unwrap added in v1.0.0

func (e *Error) Unwrap() error

Unwrap returns the wrapped error for error chain inspection.

type Func added in v0.10.0

type Func func(ctx context.Context, ch output.Channel) error

Func defines an atomic unit of work on a repository. Output should be sent to the channel, which must remain open. Closing a channel from within the context of a Func will result in a panic.

func Exec

func Exec(command string, arguments ...string) Func

Exec creates a new Func to execute the given command and arguments, streaming Stdout and Stderr to the channel and returning error status.

func Wrap

func Wrap(calls ...Func) Func

Wrap each provided Func into a new one that executes them in order before terminating.

Jump to

Keyboard shortcuts

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