Categorygithub.com/buildkite/go-buildkite/v4
modulepackage
4.1.0
Repository: https://github.com/buildkite/go-buildkite.git
Documentation: pkg.go.dev

# README

buildkite-go Go Reference Build status

A Go library and client for the Buildkite API. This project draws a lot of its structure and testing methods from go-github.

Usage

To get the package, execute:

go get github.com/buildkite/go-buildkite/v4

Simple shortened example for listing all pipelines:

import (
    "github.com/buildkite/go-buildkite/v4"
    "gopkg.in/alecthomas/kingpin.v2"
)

var (
    apiToken = kingpin.Flag("token", "API token").Required().String()
    org = kingpin.Flag("org", "Organization slug").Required().String()
)

client, err := buildkite.NewOpts(buildkite.WithTokenAuth(*apiToken))

if err != nil {
	log.Fatalf("client config failed: %s", err)
}

pipelines, _, err := client.Pipelines.List(*org, nil)

See the examples directory for additional examples.

Note: not all API features are supported by go-buildkite just yet. If you need a feature, please make an issue or submit a pull request.

Releasing

  1. Update the version number in version.go
  2. Generate a changelog using ghch: ghch --format=markdown --next-version=v<next-version-number>, and update it in CHANGELOG.md
  3. Commit and tag the new version
  4. Create a matching GitHub release

License

This library is distributed under the BSD-style license found in the LICENSE file.

# Packages

No description provided by the author

# Functions

NewClient returns a new buildkite API client with the provided options.
NewOpts is an alias for NewClient.
NewTimestamp make a new timestamp using the time suplied.
ParseWebHook parses the event payload.
ValidatePayload validates an incoming Buildkite Webhook event request and returns the (JSON) payload.
WebHookType returns the event type of webhook request r.
WithBaseURL configures the buildkite.Client to use the provided base URL, instead of the default of https://api.buildkite.com/.
WithHTTPClient configures the buildkite.Client to use the provided http.Client.
WithHTTPDebug configures the buildkite.Client to print debug information about HTTP requests and responses as it makes them.
WithTokenAuth configures the buildkite.Client to use the provided token for authentication.
WithUserAgent configures the buildkite.Client to use the provided user agent string, instead of the default of "go-buildkite/<version>".

# Constants

BuildKiteDateFormat is the format of the dates used throughout the api, note this odd string is used to parse/format dates in go.
BuildKiteEventDateFormat is the format of the dates used in webhook events.
No description provided by the author
No description provided by the author
EventTypeHeader is the Buildkite header key used to pass the event type.
SignatureHeader is the Buildkite header key used to pass the HMAC hexdigest.
Version the library version number.

# Structs

No description provided by the author
No description provided by the author
Agent represents a buildkite build agent.
AgentConnectedEvent is triggered when an agent has connected to the API Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events.
AgentDisconnectedEvent is triggered when an agent has disconnected.
agentEvent is a wrapper for an agent event notification Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events.
AgentListOptions specifies the optional parameters to the AgentService.List method.
AgentLostEvent is triggered when an agent has been marked as lost.
AgentsService handles communication with the agent related methods of the buildkite API.
AgentStoppedEvent is triggered when an agent has stopped.
AgentStoppingEvent is triggered when an agent is stopping.
Annotation represents an annotation which has been stored from a build.
No description provided by the author
AnnotationListOptions specifies the optional parameters to the AnnoationsService.List method.
AnnotationsService handles communication with the annotation related methods of the buildkite API.
Artifact represents an artifact which has been stored from a build.
ArtifactListOptions specifies the optional parameters to the ArtifactsService.List method.
ArtifactsService handles communication with the artifact related methods of the buildkite API.
Author of a commit (used in CreateBuild).
BitbucketSettings are settings for pipelines building from Bitbucket repositories.
Build represents a build which has run in buildkite.
buildEvent is a wrapper for a build event notification Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events.
BuildFailingEvent is triggered when a build enters a failing state Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events.
BuildFinishedEvent is triggered when a build finishes Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events.
BuildRunningEvent is triggered when a build starts running Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events.
BuildScheduledEvent is triggered when a build is scheduled Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events.
BuildsListOptions specifies the optional parameters to the BuildsService.List method.
BuildsService handles communication with the build related methods of the buildkite API.
No description provided by the author
Client - A Client manages communication with the buildkite API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ClusterQueuesService handles communication with cluster queue related methods of the Buildkite API.
No description provided by the author
No description provided by the author
ClustersService handles communication with cluster related methods of the Buildkite API.
No description provided by the author
No description provided by the author
No description provided by the author
ClusterTokensService handles communication with cluster token related methods of the Buildkite API.
No description provided by the author
CreateBuild - Create a build.
CreatePackageInput specifies the input parameters for the Create method.
CreatePackageRegistryInput represents the input to create a package registry.
CreatePipeline - Create a Pipeline.
CreateTeam represents a request to create a team.
CreateTeamMember represents a request to create a team member.
No description provided by the author
No description provided by the author
Creator represents who created a build.
Emoji emoji, what else can you say?.
ErrorResponse provides a message.
Event represents a Buildkite webhook event.
No description provided by the author
No description provided by the author
FlakyTestsService handles communication with flaky test related methods of the Buildkite Test Analytics API.
GitHubEnterpriseSettings are settings for pipelines building from GitHub Enterprise repositories.
GitHubSettings are settings for pipelines building from GitHub repositories.
GitLabSettings are settings for pipelines building from GitLab repositories.
Job represents a job run during a build in buildkite.
JobActivatedEvent is triggered when a job is activated Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events.
JobEnvs represent job environments output.
jobEvent is a wrapper for a job event notification Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events.
JobFinishedEvent is triggered when a job is finished Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events.
JobLog represents a job log output.
JobPriority represents the priority of the job.
JobRetrySource represents what triggered this retry.
JobScheduledEvent is triggered when a job is scheduled Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events.
JobsService handles communication with the job related methods of the buildkite API.
JobStartedEvent is triggered when a job is started Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events.
JobUnblockOptions specifies the optional parameters to UnblockJob.
ListOptions specifies the optional parameters to various List methods that support pagination.
No description provided by the author
No description provided by the author
Organization represents a buildkite organization.
OrganizationListOptions specifies the optional parameters to the OrganizationsService.List method.
OrganizationsService handles communication with the organization related methods of the buildkite API.
Package represents a package which has been stored in a registry.
PackagePresignedUpload represents a presigned upload URL for a Buildkite package, returned by the Buildkite API.
No description provided by the author
PackageRegistriesService handles communication with the package registries related Buildkite APIs.
PackageRegistry represents a package registry within Buildkite.
PackagesService handles communication with packages Buildkite API endpoints.
PingEvent is triggered when a webhook notification setting is changed Buildkite API docs: https://buildkite.com/docs/apis/webhooks/ping-events.
Pipeline represents a buildkite pipeline.
PipelineListOptions specifies the optional parameters to the PipelinesService.List method.
PipelinesService handles communication with the pipeline related methods of the buildkite API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PipelineTemplatesService handles communication with pipeline template related methods of the Buildkite API.
Provider represents a source code provider.
PullRequest represents a Github PR.
RebuiltFrom references a previous build.
Response is a buildkite API response.
Step represents a build step in buildkites build pipeline.
Team represents a buildkite team.
TeamMember represents a member of a team.
TeamMemberService handles communication with the teams related methods of the buildkite API.
TeamMembersListOptions specifies the optional parameters to the ListTeamMembers method.
No description provided by the author
No description provided by the author
No description provided by the author
TeamsListOptions specifies the optional parameters to the TeamsService.List method.
TeamsService handles communication with the teams related methods of the buildkite API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TestRunsService handles communication with test run related methods of the Buildkite Test Analytics API.
TestsService handles communication with test related methods of the Buildkite Test Analytics API.
No description provided by the author
No description provided by the author
No description provided by the author
TestSuitesService handles communication with the test suite related methods of the Buildkite Test Analytics API.
Timestamp custom timestamp to support buildkite api timestamps.
Token an oauth access token for the buildkite service.
No description provided by the author
No description provided by the author
UnblockedBy represents the unblocked status of a job, when present.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
User represents a buildkite user.
UserService handles communication with the user related methods of the buildkite API.

# Interfaces

ProviderSettings represents the sum type of the settings for different source code providers.

# Type aliases

No description provided by the author
This is kept vague (map of string to whatever) as there are a lot of custom plugins out there.
No description provided by the author