Documentation
¶
Index ¶
- Constants
- func FindBuildFailure(log []byte, numOutputLines int) []byte
- func GetToken(ctx context.Context, org string) (string, error)
- type Build
- type BuildService
- type BuildState
- type Client
- func (c *Client) BuildSummary(ctx context.Context, org string, build Build, numOutputLines int) []byte
- func (c *Client) CreateResource(ctx context.Context, pathPart string, data url.Values, v interface{}) error
- func (c *Client) DeleteResource(ctx context.Context, pathPart string, sid string) error
- func (c *Client) GetResource(ctx context.Context, pathPart string, sid string, v interface{}) error
- func (c *Client) ListResource(ctx context.Context, pathPart string, data url.Values, v interface{}) error
- func (c *Client) MakeRequest(ctx context.Context, method string, pathPart string, data url.Values, ...) error
- func (c *Client) Organization(org string) *OrganizationService
- func (c *Client) UpdateResource(ctx context.Context, pathPart string, sid string, data url.Values, ...) error
- type FileConfig
- type Job
- type JobService
- type JobState
- type ListBuildResponse
- type Log
- type Organization
- type OrganizationService
- type Pipeline
- type PipelineService
Constants ¶
View Source
const APIVersion = "v2"
View Source
const Host = "https://api.buildkite.com"
View Source
const Version = "0.13"
The buildkite-go version. Run "make release" to bump this number.
Variables ¶
This section is empty.
Functions ¶
func FindBuildFailure ¶
FindBuildFailure will attempt to find the most "interesting" part of the log, based on heuristics. At most numOutputLines will be displayed.
Types ¶
type Build ¶
type Build struct { Number int64 `json:"number"` State BuildState `json:"state"` Branch string `json:"branch"` Commit string `json:"commit"` Message string `json:"message"` WebURL string `json:"web_url"` CreatedAt time.Time `json:"created_at"` StartedAt time.Time `json:"started_at"` ScheduledAt types.NullTime `json:"scheduled_at"` FinishedAt types.NullTime `json:"finished_at"` Jobs []Job `json:"jobs"` Pipeline Pipeline `json:"pipeline"` }
type BuildService ¶
type BuildService struct {
// contains filtered or unexported fields
}
func (*BuildService) Job ¶
func (b *BuildService) Job(id string) *JobService
type BuildState ¶
type BuildState string
type Client ¶
type Client struct { *restclient.Client APIVersion string }
func (*Client) BuildSummary ¶
func (*Client) CreateResource ¶
func (c *Client) CreateResource(ctx context.Context, pathPart string, data url.Values, v interface{}) error
CreateResource makes a POST request to the given resource.
func (*Client) DeleteResource ¶
func (*Client) GetResource ¶
GetResource retrieves an instance resource with the given path part (e.g. "/Messages") and sid (e.g. "MM123").
func (*Client) ListResource ¶
func (*Client) MakeRequest ¶
func (*Client) Organization ¶
func (c *Client) Organization(org string) *OrganizationService
type FileConfig ¶
type FileConfig struct { Default string // Map key is the Buildkite name Organizations map[string]Organization `toml:"organizations"` }
func LoadConfig ¶
func LoadConfig(ctx context.Context) (*FileConfig, error)
LoadConfig loads and marshals a config file from disk. LoadConfig will look in the following locations in order:
- $XDG_CONFIG_HOME/buildkite - $HOME/cfg/buildkite - $HOME/.buildkite
func (*FileConfig) OrgForRemote ¶
func (f *FileConfig) OrgForRemote(gitRemote string) (Organization, bool)
type Job ¶
type Job struct { ID string `json:"id"` Name string `json:"name"` Command string `json:"command"` State JobState `json:"state"` CreatedAt time.Time `json:"created_at"` StartedAt time.Time `json:"started_at"` ScheduledAt types.NullTime `json:"scheduled_at"` FinishedAt types.NullTime `json:"finished_at"` LogURL string `json:"log_url"` }
type JobService ¶
type JobService struct {
// contains filtered or unexported fields
}
func (*JobService) Path ¶
func (j *JobService) Path() string
type ListBuildResponse ¶
type ListBuildResponse []Build
type Organization ¶
type OrganizationService ¶
type OrganizationService struct {
// contains filtered or unexported fields
}
func (*OrganizationService) Pipeline ¶
func (o *OrganizationService) Pipeline(pipeline string) *PipelineService
type Pipeline ¶
type Pipeline struct { ID string `json:"id"` Name string `json:"name"` Slug string `json:"slug"` CreatedAt time.Time `json:"created_at"` RunningBuildsCount int `json:"running_builds_count"` ScheduledBuildsCount int `json:"scheduled_builds_count"` RunningJobsCount int `json:"running_jobs_count"` WaitingJobsCount int `json:"waiting_jobs_count"` }
type PipelineService ¶
type PipelineService struct {
// contains filtered or unexported fields
}
func (*PipelineService) Build ¶
func (p *PipelineService) Build(number int64) *BuildService
func (*PipelineService) ListBuilds ¶
func (p *PipelineService) ListBuilds(ctx context.Context, query url.Values) (ListBuildResponse, error)
Click to show internal directories.
Click to hide internal directories.