bk

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAPIEndpoint default api endpoint
	DefaultAPIEndpoint = "https://agent.buildkite.com/v3"

	// MaxAgentConcurrentJobs jobs which can be run per agent instance
	MaxAgentConcurrentJobs = 1

	// DefaultAgentNamePrefix serverless agent name prefix used when registering the agent
	DefaultAgentNamePrefix = "serverless-agent"
)

Variables

View Source
var (
	// Version the serverless agent version
	Version = "dev"

	// BuildVersion the serverless agent version
	BuildVersion = "dev"
)

Functions

This section is empty.

Types

type API

type API interface {
	Register(string, string, []string) (*api.Agent, error)
	Beat(string) (*api.Heartbeat, error)
	Ping(string) (*api.Ping, error)
	AcceptJob(string, *api.Job) (*api.Job, error)
}

API wrap up all the buildkite api operations

type AgentAPI

type AgentAPI struct {
}

AgentAPI wrapper around all the buildkite api operations

func NewAgentAPI

func NewAgentAPI() *AgentAPI

NewAgentAPI create a new agent api

func (*AgentAPI) AcceptJob

func (ab *AgentAPI) AcceptJob(agentKey string, job *api.Job) (*api.Job, error)

AcceptJob accept the job provided by buildkite

func (*AgentAPI) Beat

func (ab *AgentAPI) Beat(agentKey string) (*api.Heartbeat, error)

Beat send a heartbeat to the agent api

func (*AgentAPI) Ping

func (ab *AgentAPI) Ping(agentKey string) (*api.Ping, error)

Ping ping the agent api for a job

func (*AgentAPI) Register

func (ab *AgentAPI) Register(agentName string, agentKey string, tags []string) (*api.Agent, error)

Register register an agent

type WorkflowData

type WorkflowData struct {
	Job                  *api.Job `json:"job,omitempty"`
	BuildID              string   `json:"build_id,omitempty"`
	BuildStatus          string   `json:"build_status,omitempty"`
	WaitTime             int      `json:"wait_time,omitempty"`
	NextToken            string   `json:"next_token,omitempty"`
	LogBytes             int      `json:"log_bytes,omitempty"`
	LogSequence          int      `json:"log_sequence,omitempty"`
	AgentName            string   `json:"agent_name,omitempty"`
	CodeBuildProjectName string   `json:"code_build_project_name,omitempty"`
}

WorkflowData this is information passed along in the step function workflow

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL