Documentation
¶
Index ¶
- Variables
- func ArtifactSummary(artifact *buildkite.Artifact) string
- func DownloadToFile(ctx context.Context, client *buildkite.Client, url, destPath string) error
- func FormatBytes(bytes int64) string
- func List(ctx context.Context, client *buildkite.Client, ...) ([]buildkite.Artifact, error)
- func ValidateState(state string) error
Constants ¶
This section is empty.
Variables ¶
var AllowedStates = []string{"new", "finished", "error", "deleted", "expired"}
AllowedStates is the closed set of artifact states the Buildkite API accepts as the state filter. Exposed so callers can reference the same list in help text and up-front validation.
See https://buildkite.com/docs/apis/rest-api/artifacts#list-artifacts-for-a-build
Functions ¶
func ArtifactSummary ¶
ArtifactSummary renders a summary of a build artifact
func DownloadToFile ¶ added in v3.55.0
DownloadToFile creates destPath (including any missing parent directories) and streams the artifact at url into it.
func FormatBytes ¶
FormatBytes formats bytes into human-readable format (KB, MB, GB, etc.)
func List ¶ added in v3.55.0
func List(ctx context.Context, client *buildkite.Client, org, pipeline, build, jobUUID, path, state string) ([]buildkite.Artifact, error)
List fetches all artifacts for a build, or for a specific job when jobUUID is non-empty, paginating through all results.
path and state are optional server-side filters. state is validated via ValidateState and lower-cased before being sent, so callers can pass user input verbatim.
func ValidateState ¶ added in v3.55.0
ValidateState rejects state values the Buildkite API won't accept, so a typo like "finshed" surfaces as a validation error instead of silently returning zero artifacts.
An empty string is treated as "no filter" and always accepted. Comparison is case-insensitive so callers can pass user input verbatim.
Types ¶
This section is empty.