Documentation ¶
Index ¶
- func IsRetryableError(err error) bool
- func NewUUID() string
- type Agent
- type AgentsService
- type Annotation
- type AnnotationsService
- type Artifact
- type ArtifactBatch
- type ArtifactBatchCreateResponse
- type ArtifactBatchUpdateArtifact
- type ArtifactBatchUpdateRequest
- type ArtifactSearchOptions
- type ArtifactUploadInstructions
- type ArtifactsService
- func (as *ArtifactsService) Create(jobId string, batch *ArtifactBatch) (*ArtifactBatchCreateResponse, *Response, error)
- func (as *ArtifactsService) Search(buildId string, opt *ArtifactSearchOptions) ([]*Artifact, *Response, error)
- func (as *ArtifactsService) Update(jobId string, artifactStates map[string]string) (*Response, error)
- type AuthenticatedTransport
- type Chunk
- type ChunksService
- type Client
- func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)
- func (c *Client) NewFormRequest(method, urlStr string, body *bytes.Buffer) (*http.Request, error)
- func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *Client) NewRequestWithMessagePack(method, urlStr string, body interface{}) (*http.Request, error)
- type ErrorResponse
- type HeaderTimes
- type HeaderTimesService
- type Heartbeat
- type HeartbeatsService
- type Job
- type JobState
- type JobsService
- type MetaData
- type MetaDataExists
- type MetaDataService
- type Ping
- type PingsService
- type Pipeline
- type PipelinesService
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRetryableError ¶
Looks at a bunch of connection related errors, and returns true if the error matches one of them.
Types ¶
type Agent ¶
type Agent struct { Name string `json:"name" msgpack:"name"` AccessToken string `json:"access_token" msgpack:"access_token"` Hostname string `json:"hostname" msgpack:"hostname"` Endpoint string `json:"endpoint" msgpack:"endpoint"` PingInterval int `json:"ping_interval" msgpack:"ping_interval"` JobStatusInterval int `json:"job_status_interval" msgpack:"job_status_interval"` HearbeatInterval int `json:"heartbeat_interval" msgpack:"heartbeat_interval"` OS string `json:"os" msgpack:"os"` Arch string `json:"arch" msgpack:"arch"` ScriptEvalEnabled bool `json:"script_eval_enabled" msgpack:"script_eval_enabled"` Priority string `json:"priority,omitempty" msgpack:"priority,omitempty"` Version string `json:"version" msgpack:"version"` Build string `json:"build" msgpack:"build"` Tags []string `json:"meta_data" msgpack:"meta_data"` PID int `json:"pid,omitempty" msgpack:"pid,omitempty"` }
Agent represents an agent on the Buildkite Agent API
type AgentsService ¶
type AgentsService struct {
// contains filtered or unexported fields
}
AgentsService handles communication with the agent related methods of the Buildkite Agent API.
func (*AgentsService) Connect ¶
func (as *AgentsService) Connect() (*Response, error)
Connects the agent to the Buildkite Agent API
func (*AgentsService) Disconnect ¶
func (as *AgentsService) Disconnect() (*Response, error)
Disconnects the agent to the Buildkite Agent API
type Annotation ¶
type Annotation struct { Body string `json:"body,omitempty"` Context string `json:"context,omitempty"` Style string `json:"style,omitempty"` Append bool `json:"append,omitempty"` }
Annotation represents a Buildkite Agent API Annotation
type AnnotationsService ¶
type AnnotationsService struct {
// contains filtered or unexported fields
}
AnnotationsService handles communication with the annotation related methods of the Buildkite Agent API.
func (*AnnotationsService) Create ¶
func (cs *AnnotationsService) Create(jobId string, annotation *Annotation) (*Response, error)
Annotates a build in the Buildkite UI
type Artifact ¶
type Artifact struct { // The ID of the artifact. The ID is assigned to it after a successful // batch creation ID string `json:"-"` // The path to the artifact relative to the working directory Path string `json:"path"` // The absolute path to the artifact AbsolutePath string `json:"absolute_path"` // The glob path used to find this artifact GlobPath string `json:"glob_path"` // The size of the file in bytes FileSize int64 `json:"file_size"` // A Sha1Sum calculation of the file Sha1Sum string `json:"sha1sum"` // The HTTP url to this artifact once it's been uploaded URL string `json:"url,omitempty"` // The destination specified on the command line when this file was // uploaded UploadDestination string `json:"upload_destination,omitempty"` // Information on how to upload this artifact. UploadInstructions *ArtifactUploadInstructions `json:"-"` }
Artifact represents an artifact on the Buildkite Agent API
type ArtifactBatch ¶
type ArtifactBatchCreateResponse ¶
type ArtifactBatchCreateResponse struct { ID string `json:"id"` ArtifactIDs []string `json:"artifact_ids"` UploadInstructions *ArtifactUploadInstructions `json:"upload_instructions"` }
type ArtifactBatchUpdateRequest ¶
type ArtifactBatchUpdateRequest struct {
Artifacts []*ArtifactBatchUpdateArtifact `json:"artifacts"`
}
type ArtifactSearchOptions ¶
type ArtifactSearchOptions struct { Query string `url:"query,omitempty"` Scope string `url:"scope,omitempty"` }
ArtifactSearchOptions specifies the optional parameters to the ArtifactsService.Search method.
type ArtifactsService ¶
type ArtifactsService struct {
// contains filtered or unexported fields
}
ArtifactsService handles communication with the artifact related methods of the Buildkite Artifact API.
func (*ArtifactsService) Create ¶
func (as *ArtifactsService) Create(jobId string, batch *ArtifactBatch) (*ArtifactBatchCreateResponse, *Response, error)
Accepts a slice of artifacts, and creates them on Buildkite as a batch.
func (*ArtifactsService) Search ¶
func (as *ArtifactsService) Search(buildId string, opt *ArtifactSearchOptions) ([]*Artifact, *Response, error)
Searches Buildkite for a set of artifacts
type AuthenticatedTransport ¶
type AuthenticatedTransport struct { // The Token used for authentication. This can either the be // organizations registration token, or the agents access token. Token string // Transport is the underlying HTTP transport to use when making // requests. It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
Transport manages injection of the API token
func (*AuthenticatedTransport) CancelRequest ¶
func (t *AuthenticatedTransport) CancelRequest(req *http.Request)
CancelRequest cancels an in-flight request by closing its connection.
type ChunksService ¶
type ChunksService struct {
// contains filtered or unexported fields
}
ChunksService handles communication with the chunk related methods of the Buildkite Agent API.
type Client ¶
type Client struct { // Base URL for API requests. Defaults to the public Buildkite Agent API. // The URL should always be specified with a trailing slash. BaseURL *url.URL // User agent used when communicating with the Buildkite Agent API. UserAgent string // If true, requests and responses will be dumped and set to the logger DebugHTTP bool // Services used for talking to different parts of the Buildkite Agent API. Agents *AgentsService Pings *PingsService Jobs *JobsService Chunks *ChunksService MetaData *MetaDataService HeaderTimes *HeaderTimesService Artifacts *ArtifactsService Pipelines *PipelinesService Heartbeats *HeartbeatsService Annotations *AnnotationsService // contains filtered or unexported fields }
A Client manages communication with the Buildkite Agent API.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewFormRequest ¶
NewFormRequest creates an multi-part form request. A relative URL can be provided in urlStr, in which case it is resolved relative to the UploadURL of the Client. Relative URLs should always be specified without a preceding slash.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error Message string `json:"message" msgpack:"message"` // error message }
ErrorResponse provides a message.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type HeaderTimes ¶
HeaderTimes represents a set of header times that are associated with a job log.
type HeaderTimesService ¶
type HeaderTimesService struct {
// contains filtered or unexported fields
}
HeaderTimesService handles communication with the meta data related methods of the Buildkite Agent API.
func (*HeaderTimesService) Save ¶
func (hs *HeaderTimesService) Save(jobId string, headerTimes *HeaderTimes) (*Response, error)
Saves the header times to the job
type Heartbeat ¶
type Heartbeat struct { SentAt string `json:"sent_at"` ReceivedAt string `json:"received_at,omitempty"` }
Heartbeat represents a Buildkite Agent API Heartbeat
type HeartbeatsService ¶
type HeartbeatsService struct {
// contains filtered or unexported fields
}
HeartbeatsService handles communication with the ping related methods of the Buildkite Agent API.
type Job ¶
type Job struct { ID string `json:"id,omitempty"` Endpoint string `json:"endpoint"` State string `json:"state,omitempty"` Env map[string]string `json:"env,omitempty"` ChunksMaxSizeBytes int `json:"chunks_max_size_bytes,omitempty"` ExitStatus string `json:"exit_status,omitempty"` StartedAt string `json:"started_at,omitempty"` FinishedAt string `json:"finished_at,omitempty"` ChunksFailedCount int `json:"chunks_failed_count,omitempty"` }
Job represents a Buildkite Agent API Job
type JobsService ¶
type JobsService struct {
// contains filtered or unexported fields
}
JobsService handles communication with the job related methods of the Buildkite Agent API.
func (*JobsService) Accept ¶
func (js *JobsService) Accept(job *Job) (*Job, *Response, error)
Accepts the passed in job. Returns the job with it's finalized set of environment variables (when a job is accepted, the agents environment is applied to the job)
func (*JobsService) Finish ¶
func (js *JobsService) Finish(job *Job) (*Response, error)
Finishes the passed in job
type MetaDataExists ¶
type MetaDataExists struct {
Exists bool `json:"exists"`
}
MetaDataExists represents a Buildkite Agent API MetaData Exists check response
type MetaDataService ¶
type MetaDataService struct {
// contains filtered or unexported fields
}
MetaDataService handles communication with the meta data related methods of the Buildkite Agent API.
func (*MetaDataService) Exists ¶
func (ps *MetaDataService) Exists(jobId string, key string) (*MetaDataExists, *Response, error)
Returns true if the meta data key has been set, false if it hasn't.
type Ping ¶
type Ping struct { Action string `json:"action,omitempty"` Message string `json:"message,omitempty"` Job *Job `json:"job,omitempty"` Endpoint string `json:"endpoint,omitempty"` }
Ping represents a Buildkite Agent API Ping
type PingsService ¶
type PingsService struct {
// contains filtered or unexported fields
}
PingsService handles communication with the ping related methods of the Buildkite Agent API.
type Pipeline ¶
type Pipeline struct { UUID string `json:"uuid"` Pipeline interface{} `json:"pipeline"` Replace bool `json:"replace,omitempty"` }
Pipeline represents a Buildkite Agent API Pipeline
type PipelinesService ¶
type PipelinesService struct {
// contains filtered or unexported fields
}
PipelinesService handles communication with the pipeline related methods of the Buildkite Agent API.