Documentation ¶
Index ¶
- Variables
- func APIClientEnableHTTPDebug()
- func OSDump() (string, error)
- func Version() string
- func Worker(id int, ls *LogStreamer)
- type APIClient
- type AgentConfiguration
- type AgentPool
- type AgentWorker
- type ArtifactBatchCreator
- type ArtifactDownloader
- type ArtifactSearcher
- type ArtifactUploader
- type Download
- type EC2Tags
- type FormUploader
- type HeaderTimesStreamer
- type JobRunner
- type LogStreamer
- type LogStreamerChunk
- type S3Uploader
- type Uploader
Constants ¶
This section is empty.
Variables ¶
var HeaderRegex = regexp.MustCompile("^(?:---|\\+\\+\\+|~~~)\\s(.+)?$")
Functions ¶
func APIClientEnableHTTPDebug ¶
func APIClientEnableHTTPDebug()
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()
Stops the agent from accepting new work and cancels any current work it's running
type ArtifactBatchCreator ¶
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) NormalizedPath ¶
func (a *ArtifactUploader) NormalizedPath(path string) string
func (*ArtifactUploader) Upload ¶
func (a *ArtifactUploader) Upload() error
func (*ArtifactUploader) WorkingDirectory ¶
func (a *ArtifactUploader) WorkingDirectory(path string) string
type Download ¶
type FormUploader ¶
type FormUploader struct { }
func (*FormUploader) Setup ¶
func (u *FormUploader) Setup(destination string) error
type HeaderTimesStreamer ¶
type HeaderTimesStreamer struct { // The callback that will be called when a header time is ready for // upload Callback func(int, int, map[string]string) // contains filtered or unexported fields }
func (*HeaderTimesStreamer) Now ¶
func (h *HeaderTimesStreamer) Now(line string)
func (*HeaderTimesStreamer) Scan ¶
func (h *HeaderTimesStreamer) Scan(line string)
func (*HeaderTimesStreamer) Upload ¶
func (h *HeaderTimesStreamer) Upload()
func (*HeaderTimesStreamer) Wait ¶
func (h *HeaderTimesStreamer) Wait()
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 S3Uploader ¶
type S3Uploader struct { // The destination which includes the S3 bucket name // and the path. // s3://my-bucket-name/foo/bar Destination string // The S3 Bucket we're uploading these files to Bucket *s3.Bucket }
func (*S3Uploader) Setup ¶
func (u *S3Uploader) Setup(destination string) error
Source Files ¶
- agent_configuration.go
- agent_pool.go
- agent_worker.go
- api_client.go
- artifact_batch_creator.go
- artifact_downloader.go
- artifact_searcher.go
- artifact_uploader.go
- download.go
- ec2_tags.go
- form_uploader.go
- header_times_streamer.go
- job_runner.go
- log_streamer.go
- os_dump.go
- s3_uploader.go
- uploader.go
- version.go