Documentation
¶
Overview ¶
Package call provides helpers for managing and executing asynchronous work
across multiple repositories. Commands for this batch tool shall execute
`Do(...)` with a Wrapper containing all of the tasks for that command.
Example:
repos := []string{"repo1", "repo2", "repo3"}
fwrap := Wrap(Exec("git", "status"), Exec("ls"))
Do(repos, fwrap)
The above example code calls `git status` followed by `ls` on all three
provided repositories, executing asynchronously and printing the output
in order. Console output will block iteratively across the repository
list to ensure that the output isn't mixed, but the processing of each
repository's respective tasks is fully parallel in the background.
The `Exec` Func builder should be sufficient for most commands, but
custom Func instances can be defined for more complex scenarios. It
is also possible to define entire `Wrapper` instances if a specific use
case requires special handling distinct from the default behavior.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
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 Func ¶ added in v0.10.0
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.