Documentation
¶
Index ¶
- Variables
- func APIClientEnableHTTPDebug()
- func BuildVersion() string
- func Version() string
- func Worker(id int, ls *LogStreamer)
- type APIClient
- type AgentConfiguration
- type AgentPool
- type AgentWorker
- func (a *AgentWorker) Connect() error
- func (a AgentWorker) Create() AgentWorker
- func (a *AgentWorker) Disconnect() error
- func (a *AgentWorker) Heartbeat() error
- func (a *AgentWorker) Ping()
- func (a *AgentWorker) Start() error
- func (a *AgentWorker) Stop(graceful bool)
- func (a *AgentWorker) UpdateProcTitle(action string)
- type ArtifactBatchCreator
- type ArtifactDownloader
- type ArtifactSearcher
- type ArtifactUploader
- type Download
- type EC2Tags
- type FormUploader
- type HeaderTimesStreamer
- type JobRunner
- type LogStreamer
- type LogStreamerChunk
- type S3Downloader
- type S3Uploader
- type Uploader
Constants ¶
This section is empty.
Variables ¶
var ArtifactPathVariableRegex = regexp.MustCompile("\\$\\{artifact\\:path\\}")
var HeaderRegex = regexp.MustCompile("^(?:---|\\+\\+\\+|~~~)\\s(.+)?$")
Functions ¶
func APIClientEnableHTTPDebug ¶
func APIClientEnableHTTPDebug()
func BuildVersion ¶
func BuildVersion() string
Types ¶
type AgentConfiguration ¶
type AgentPool ¶
type AgentPool struct {
APIClient *api.Client
Token string
ConfigFilePath string
Name string
Priority string
MetaData []string
MetaDataEC2Tags bool
Endpoint string
AgentConfiguration *AgentConfiguration
}
func (*AgentPool) CreateAgentTemplate ¶
Takes the options passed to the CLI, and creates an api.Agent record that will be sent to the Buildkite Agent API for registration.
func (*AgentPool) RegisterAgent ¶
Takes the agent template and returns a registered agent. The registered agent includes the Access Token used to communicate with the Buildkite Agent API
func (*AgentPool) ShowBanner ¶
func (r *AgentPool) ShowBanner()
Shows the welcome banner and the configuration options used when starting this agent.
type AgentWorker ¶
type AgentWorker struct {
// The API Client used when this agent is communicating with the API
APIClient *api.Client
// The endpoint that should be used when communicating with the API
Endpoint string
// The registred agent API record
Agent *api.Agent
// The configuration of the agent from the CLI
AgentConfiguration *AgentConfiguration
// contains filtered or unexported fields
}
func (*AgentWorker) Connect ¶
func (a *AgentWorker) Connect() error
Connects the agent to the Buildkite Agent API, retrying up to 30 times if it fails.
func (AgentWorker) Create ¶
func (a AgentWorker) Create() AgentWorker
Creates the agent worker and initializes it's API Client
func (*AgentWorker) Disconnect ¶
func (a *AgentWorker) Disconnect() error
Disconnects the agent from the Buildkite Agent API, doesn't bother retrying because we want to disconnect as fast as possible.
func (*AgentWorker) Ping ¶
func (a *AgentWorker) Ping()
Performs a ping, which returns what action the agent should take next.
func (*AgentWorker) Stop ¶
func (a *AgentWorker) Stop(graceful bool)
Stops the agent from accepting new work and cancels any current work it's running
func (*AgentWorker) UpdateProcTitle ¶
func (a *AgentWorker) UpdateProcTitle(action string)
type ArtifactBatchCreator ¶
type ArtifactBatchCreator struct {
// The APIClient that will be used when uploading jobs
APIClient *api.Client
// The ID of the Job that these artifacts belong to
JobID string
// All the artifacts that need to be created
Artifacts []*api.Artifact
// Where the artifacts are being uploaded to on the command line
UploadDestination string
}
type ArtifactDownloader ¶
type ArtifactDownloader struct {
// The APIClient that will be used when uploading jobs
APIClient *api.Client
// The ID of the Build
BuildID string
// The query used to find the artifacts
Query string
// Which step should we look at for the jobs
Step string
// Where we'll be downloading artifacts to
Destination string
}
func (*ArtifactDownloader) Download ¶
func (a *ArtifactDownloader) Download() error
type ArtifactSearcher ¶
type ArtifactUploader ¶
type ArtifactUploader struct {
// The APIClient that will be used when uploading jobs
APIClient *api.Client
// The ID of the Job
JobID string
// The path of the uploads
Paths string
// Where we'll be uploading artifacts
Destination string
}
func (*ArtifactUploader) Collect ¶
func (a *ArtifactUploader) Collect() (artifacts []*api.Artifact, err error)
func (*ArtifactUploader) Upload ¶
func (a *ArtifactUploader) Upload() error
type Download ¶
type Download struct {
// The actual URL to get the file from
URL string
// The root directory of the download
Destination string
// The relative path that should be preserved in the download folder
Path string
// How many times should it retry the download before giving up
Retries int
// If failed responses should be dumped to the log
DebugHTTP bool
}
type FormUploader ¶
type FormUploader struct {
// Whether or not HTTP calls shoud be debugged
DebugHTTP bool
}
type HeaderTimesStreamer ¶
type HeaderTimesStreamer struct {
// The callback that will be called when a header time is ready for
// upload
UploadCallback func(int, int, map[string]string)
// contains filtered or unexported fields
}
func (*HeaderTimesStreamer) Scan ¶
func (h *HeaderTimesStreamer) Scan(line string)
func (*HeaderTimesStreamer) Start ¶
func (h *HeaderTimesStreamer) Start() error
func (*HeaderTimesStreamer) Stop ¶
func (h *HeaderTimesStreamer) Stop()
func (*HeaderTimesStreamer) Upload ¶
func (h *HeaderTimesStreamer) Upload()
type JobRunner ¶
type JobRunner struct {
// The job being run
Job *api.Job
// The APIClient that will be used when updating the job
APIClient *api.Client
// The endpoint that should be used when communicating with the API
Endpoint string
// The registred agent API record running this job
Agent *api.Agent
// The configuration of the agent from the CLI
AgentConfiguration *AgentConfiguration
// contains filtered or unexported fields
}
type LogStreamer ¶
type LogStreamer struct {
// How many log streamer workers are running at any one time
Concurrency int
// The maximum size of chunks
MaxChunkSizeBytes int
// A counter of how many chunks failed to upload
ChunksFailedCount int32
// The callback called when a chunk is ready for upload
Callback func(chunk *LogStreamerChunk) error
// contains filtered or unexported fields
}
func (LogStreamer) New ¶
func (ls LogStreamer) New() *LogStreamer
Creates a new instance of the log streamer
func (*LogStreamer) Process ¶
func (ls *LogStreamer) Process(output string) error
Takes the full process output, grabs the portion we don't have, and adds it to the stream queue
func (*LogStreamer) Start ¶
func (ls *LogStreamer) Start() error
Spins up x number of log streamer workers
func (*LogStreamer) Stop ¶
func (ls *LogStreamer) Stop() error
Waits for all the chunks to be uploaded, then shuts down all the workers
type LogStreamerChunk ¶
type S3Downloader ¶
type S3Downloader struct {
// The name of the bucket
Bucket string
// The root directory of the download
Destination string
// The relative path that should be preserved in the download folder,
// also it's location in the bucket
Path string
// How many times should it retry the download before giving up
Retries int
// If failed responses should be dumped to the log
DebugHTTP bool
}
func (S3Downloader) Start ¶
func (d S3Downloader) Start() error