artifact

package
v3.60.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func ArtifactSummary(artifact *buildkite.Artifact) string

ArtifactSummary renders a summary of a build artifact

func DownloadToFile added in v3.55.0

func DownloadToFile(ctx context.Context, client *buildkite.Client, url, destPath string) error

DownloadToFile creates destPath (including any missing parent directories) and streams the artifact at url into it.

func FormatBytes

func FormatBytes(bytes int64) string

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 string, paths []string, 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.

paths and state are optional server-side filters. Paths are queried separately and results are deduplicated by artifact ID, preserving first-seen order. Wildcard matching is left to the API. state is validated and lower-cased.

func ValidateState added in v3.55.0

func ValidateState(state string) error

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.

Jump to

Keyboard shortcuts

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