Documentation ¶
Index ¶
- Constants
- Variables
- type AggregatePlan
- type ArtifactOutputPlan
- type Build
- type BuildInput
- type BuildInputsOutputs
- type BuildPreparation
- type BuildPreparationStatus
- type BuildStatus
- type CacheConfig
- type Cause
- type CheckRequestBody
- type CheckResponseBody
- type ClearTaskCacheResponse
- type Config
- type ConfigResponse
- type Container
- type ContainerLimits
- type DependentGetPlan
- type DoPlan
- type EnsurePlan
- type Event
- type EventType
- type EventVersion
- type GetPlan
- type GroupConfig
- type GroupConfigs
- type HijackInput
- type HijackOutput
- type HijackProcessSpec
- type HijackTTYSpec
- type HijackWindowSize
- type Hooks
- type ImageResource
- type Info
- type Job
- type JobConfig
- func (config JobConfig) GetSerialGroups() []string
- func (config JobConfig) Hooks() Hooks
- func (config JobConfig) InputPlans() []PlanConfig
- func (config JobConfig) Inputs() []JobInput
- func (config JobConfig) MaxInFlight() int
- func (config JobConfig) OutputPlans() []PlanConfig
- func (config JobConfig) Outputs() []JobOutput
- func (config JobConfig) Plans() []PlanConfig
- type JobConfigs
- type JobInput
- type JobOutput
- type LogLevel
- type MalformedConfigError
- type MetadataField
- type MissingInputReasons
- type OnAbortPlan
- type OnFailurePlan
- type OnSuccessPlan
- type Params
- type PathFlag
- type Pipe
- type Pipeline
- type Plan
- type PlanConfig
- type PlanFactory
- type PlanID
- type PlanSequence
- type PruneWorkerResponseBody
- type PublicBuildInput
- type PublicBuildPlan
- type PutPlan
- type RawConfig
- type RenameRequest
- type Resource
- type ResourceConfig
- type ResourceConfigs
- type ResourceType
- type ResourceTypes
- type RetryPlan
- type Source
- type Step
- type Tags
- type TaskConfig
- type TaskInputConfig
- type TaskOutputConfig
- type TaskPlan
- type TaskRunConfig
- type Team
- type TimeoutPlan
- type TryPlan
- type UserArtifactPlan
- type Version
- type VersionConfig
- type VersionedResource
- type VersionedResourceType
- type VersionedResourceTypes
- type Volume
- type VolumeBaseResourceType
- type VolumeResourceType
- type Warning
- type Worker
- type WorkerResourceType
Constants ¶
const ( ContainerStateCreated = "created" ContainerStateCreating = "creating" ContainerStateDestroying = "destroying" ContainerStateFailed = "failed" )
const ( LinkRelNext = "next" LinkRelPrevious = "previous" PaginationQuerySince = "since" PaginationQueryUntil = "until" PaginationQueryFrom = "from" PaginationQueryTo = "to" PaginationQueryLimit = "limit" PaginationWebLimit = 100 PaginationAPIDefaultLimit = 100 )
const ( SaveConfig = "SaveConfig" GetConfig = "GetConfig" GetBuild = "GetBuild" GetBuildPlan = "GetBuildPlan" CreateBuild = "CreateBuild" ListBuilds = "ListBuilds" BuildEvents = "BuildEvents" BuildResources = "BuildResources" AbortBuild = "AbortBuild" GetBuildPreparation = "GetBuildPreparation" GetJob = "GetJob" CreateJobBuild = "CreateJobBuild" ListAllJobs = "ListAllJobs" ListJobs = "ListJobs" ListJobBuilds = "ListJobBuilds" ListJobInputs = "ListJobInputs" GetJobBuild = "GetJobBuild" PauseJob = "PauseJob" UnpauseJob = "UnpauseJob" GetVersionsDB = "GetVersionsDB" JobBadge = "JobBadge" MainJobBadge = "MainJobBadge" ClearTaskCache = "ClearTaskCache" ListAllResources = "ListAllResources" ListResources = "ListResources" ListResourceTypes = "ListResourceTypes" GetResource = "GetResource" PauseResource = "PauseResource" UnpauseResource = "UnpauseResource" CheckResource = "CheckResource" CheckResourceWebHook = "CheckResourceWebHook" CheckResourceType = "CheckResourceType" ListResourceVersions = "ListResourceVersions" GetResourceVersion = "GetResourceVersion" EnableResourceVersion = "EnableResourceVersion" DisableResourceVersion = "DisableResourceVersion" ListBuildsWithVersionAsInput = "ListBuildsWithVersionAsInput" ListBuildsWithVersionAsOutput = "ListBuildsWithVersionAsOutput" GetResourceCausality = "GetResourceCausality" ListAllPipelines = "ListAllPipelines" ListPipelines = "ListPipelines" GetPipeline = "GetPipeline" DeletePipeline = "DeletePipeline" OrderPipelines = "OrderPipelines" PausePipeline = "PausePipeline" UnpausePipeline = "UnpausePipeline" ExposePipeline = "ExposePipeline" HidePipeline = "HidePipeline" RenamePipeline = "RenamePipeline" ListPipelineBuilds = "ListPipelineBuilds" CreatePipelineBuild = "CreatePipelineBuild" PipelineBadge = "PipelineBadge" RegisterWorker = "RegisterWorker" LandWorker = "LandWorker" RetireWorker = "RetireWorker" PruneWorker = "PruneWorker" HeartbeatWorker = "HeartbeatWorker" ListWorkers = "ListWorkers" DeleteWorker = "DeleteWorker" SetLogLevel = "SetLogLevel" GetLogLevel = "GetLogLevel" DownloadCLI = "DownloadCLI" GetInfo = "Info" GetInfoCreds = "InfoCreds" ListContainers = "ListContainers" GetContainer = "GetContainer" HijackContainer = "HijackContainer" ListDestroyingContainers = "ListDestroyingContainers" ReportWorkerContainers = "ReportWorkerContainers" ListVolumes = "ListVolumes" ListDestroyingVolumes = "ListDestroyingVolumes" ReportWorkerVolumes = "ReportWorkerVolumes" ListTeams = "ListTeams" SetTeam = "SetTeam" RenameTeam = "RenameTeam" DestroyTeam = "DestroyTeam" ListTeamBuilds = "ListTeamBuilds" SendInputToBuildPlan = "SendInputToBuildPlan" ReadOutputFromBuildPlan = "ReadOutputFromBuildPlan" )
const ( ClearTaskCacheQueryPath = "cache_path" SaveConfigCheckCreds = "check_creds" )
const ConfigVersionHeader = "X-Concourse-Config-Version"
const DefaultPipelineName = "main"
const DefaultTeamName = "main"
const MemoryRegex = "^([0-9]+)([G|M|K|g|m|k]?[b|B])?$"
const VersionEvery = "every"
const VersionLatest = "latest"
Variables ¶
var ContainerLimitsDecodeHook = func( srcType reflect.Type, dstType reflect.Type, data interface{}, ) (interface{}, error) { if dstType != reflect.TypeOf(ContainerLimits{}) { return data, nil } var containerLimits ContainerLimits if limitsData, ok := data.(interface{}); ok { return ContainerLimitsParser(limitsData) } return containerLimits, nil }
var ContainerLimitsParser = func(data interface{}) (ContainerLimits, error) { var c ContainerLimits mapData := make(map[string]interface{}) switch data.(type) { case map[interface{}]interface{}: for key, value := range data.(map[interface{}]interface{}) { sKey := key.(string) mapData[sKey] = value } case map[string]interface{}: mapData = data.(map[string]interface{}) } var memoryBytes uint64 var uVal int var err error for key, val := range mapData { if key == "memory" { switch val.(type) { case string: memoryBytes, err = parseMemoryLimit(val.(string)) if err != nil { return ContainerLimits{}, err } case *string: if val.(*string) == nil { c.Memory = nil continue } memoryBytes, err = parseMemoryLimit(*val.(*string)) if err != nil { return ContainerLimits{}, err } case float64: memoryBytes = uint64(int(val.(float64))) case int: memoryBytes = uint64(val.(int)) } c.Memory = &memoryBytes } else if key == "cpu" { switch val.(type) { case float64: uVal = int(val.(float64)) case int: uVal = val.(int) case *int: if val.(*int) == nil { c.CPU = nil continue } uVal = *val.(*int) default: return ContainerLimits{}, errors.New("cpu limit must be an integer") } helper := uint64(uVal) c.CPU = &helper } } return c, nil }
var ErrInvalidWorkerVersion = errors.New("invalid worker version, only numeric characters are allowed")
var ErrMissingWorkerGardenAddress = errors.New("missing garden address")
var Routes = rata.Routes([]rata.Route{ {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/config", Method: "PUT", Name: SaveConfig}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/config", Method: "GET", Name: GetConfig}, {Path: "/api/v1/teams/:team_name/builds", Method: "POST", Name: CreateBuild}, {Path: "/api/v1/builds", Method: "GET", Name: ListBuilds}, {Path: "/api/v1/builds/:build_id", Method: "GET", Name: GetBuild}, {Path: "/api/v1/builds/:build_id/plan", Method: "GET", Name: GetBuildPlan}, {Path: "/api/v1/builds/:build_id/plan/:plan_id/input", Method: "PUT", Name: SendInputToBuildPlan}, {Path: "/api/v1/builds/:build_id/plan/:plan_id/output", Method: "GET", Name: ReadOutputFromBuildPlan}, {Path: "/api/v1/builds/:build_id/events", Method: "GET", Name: BuildEvents}, {Path: "/api/v1/builds/:build_id/resources", Method: "GET", Name: BuildResources}, {Path: "/api/v1/builds/:build_id/abort", Method: "PUT", Name: AbortBuild}, {Path: "/api/v1/builds/:build_id/preparation", Method: "GET", Name: GetBuildPreparation}, {Path: "/api/v1/jobs", Method: "GET", Name: ListAllJobs}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs", Method: "GET", Name: ListJobs}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name", Method: "GET", Name: GetJob}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds", Method: "GET", Name: ListJobBuilds}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds", Method: "POST", Name: CreateJobBuild}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/inputs", Method: "GET", Name: ListJobInputs}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds/:build_name", Method: "GET", Name: GetJobBuild}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/pause", Method: "PUT", Name: PauseJob}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/unpause", Method: "PUT", Name: UnpauseJob}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/badge", Method: "GET", Name: JobBadge}, {Path: "/api/v1/pipelines/:pipeline_name/jobs/:job_name/badge", Method: "GET", Name: MainJobBadge}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/tasks/:step_name/cache", Method: "DELETE", Name: ClearTaskCache}, {Path: "/api/v1/pipelines", Method: "GET", Name: ListAllPipelines}, {Path: "/api/v1/teams/:team_name/pipelines", Method: "GET", Name: ListPipelines}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name", Method: "GET", Name: GetPipeline}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name", Method: "DELETE", Name: DeletePipeline}, {Path: "/api/v1/teams/:team_name/pipelines/ordering", Method: "PUT", Name: OrderPipelines}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/pause", Method: "PUT", Name: PausePipeline}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/unpause", Method: "PUT", Name: UnpausePipeline}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/expose", Method: "PUT", Name: ExposePipeline}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/hide", Method: "PUT", Name: HidePipeline}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/versions-db", Method: "GET", Name: GetVersionsDB}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/rename", Method: "PUT", Name: RenamePipeline}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/builds", Method: "GET", Name: ListPipelineBuilds}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/builds", Method: "POST", Name: CreatePipelineBuild}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/badge", Method: "GET", Name: PipelineBadge}, {Path: "/api/v1/resources", Method: "GET", Name: ListAllResources}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources", Method: "GET", Name: ListResources}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resource-types", Method: "GET", Name: ListResourceTypes}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name", Method: "GET", Name: GetResource}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/pause", Method: "PUT", Name: PauseResource}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/unpause", Method: "PUT", Name: UnpauseResource}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/check", Method: "POST", Name: CheckResource}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/check/webhook", Method: "POST", Name: CheckResourceWebHook}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resource-types/:resource_name/check", Method: "POST", Name: CheckResourceType}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions", Method: "GET", Name: ListResourceVersions}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id", Method: "GET", Name: GetResourceVersion}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/enable", Method: "PUT", Name: EnableResourceVersion}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/disable", Method: "PUT", Name: DisableResourceVersion}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/input_to", Method: "GET", Name: ListBuildsWithVersionAsInput}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/output_of", Method: "GET", Name: ListBuildsWithVersionAsOutput}, {Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/causality", Method: "GET", Name: GetResourceCausality}, {Path: "/api/v1/workers", Method: "GET", Name: ListWorkers}, {Path: "/api/v1/workers", Method: "POST", Name: RegisterWorker}, {Path: "/api/v1/workers/:worker_name/land", Method: "PUT", Name: LandWorker}, {Path: "/api/v1/workers/:worker_name/retire", Method: "PUT", Name: RetireWorker}, {Path: "/api/v1/workers/:worker_name/prune", Method: "PUT", Name: PruneWorker}, {Path: "/api/v1/workers/:worker_name/heartbeat", Method: "PUT", Name: HeartbeatWorker}, {Path: "/api/v1/workers/:worker_name", Method: "DELETE", Name: DeleteWorker}, {Path: "/api/v1/log-level", Method: "GET", Name: GetLogLevel}, {Path: "/api/v1/log-level", Method: "PUT", Name: SetLogLevel}, {Path: "/api/v1/cli", Method: "GET", Name: DownloadCLI}, {Path: "/api/v1/info", Method: "GET", Name: GetInfo}, {Path: "/api/v1/info/creds", Method: "GET", Name: GetInfoCreds}, {Path: "/api/v1/containers/destroying", Method: "GET", Name: ListDestroyingContainers}, {Path: "/api/v1/containers/report", Method: "PUT", Name: ReportWorkerContainers}, {Path: "/api/v1/teams/:team_name/containers", Method: "GET", Name: ListContainers}, {Path: "/api/v1/teams/:team_name/containers/:id", Method: "GET", Name: GetContainer}, {Path: "/api/v1/teams/:team_name/containers/:id/hijack", Method: "GET", Name: HijackContainer}, {Path: "/api/v1/teams/:team_name/volumes", Method: "GET", Name: ListVolumes}, {Path: "/api/v1/volumes/destroying", Method: "GET", Name: ListDestroyingVolumes}, {Path: "/api/v1/volumes/report", Method: "PUT", Name: ReportWorkerVolumes}, {Path: "/api/v1/teams", Method: "GET", Name: ListTeams}, {Path: "/api/v1/teams/:team_name", Method: "PUT", Name: SetTeam}, {Path: "/api/v1/teams/:team_name/rename", Method: "PUT", Name: RenameTeam}, {Path: "/api/v1/teams/:team_name", Method: "DELETE", Name: DestroyTeam}, {Path: "/api/v1/teams/:team_name/builds", Method: "GET", Name: ListTeamBuilds}, })
var SanitizeDecodeHook = func( dataKind reflect.Kind, valKind reflect.Kind, data interface{}, ) (interface{}, error) { if valKind == reflect.Map { if dataKind == reflect.Map { return sanitize(data) } } if valKind == reflect.String { if dataKind == reflect.String { return data, nil } if dataKind == reflect.Float64 { if f, ok := data.(float64); ok { return strconv.FormatFloat(f, 'f', -1, 64), nil } return nil, errors.New("impossible: float64 != float64") } return json.Marshal(data) } return data, nil }
var VersionConfigDecodeHook = func( srcType reflect.Type, dstType reflect.Type, data interface{}, ) (interface{}, error) { if dstType != reflect.TypeOf(VersionConfig{}) { return data, nil } switch { case srcType.Kind() == reflect.String: if s, ok := data.(string); ok { return VersionConfig{ Every: s == VersionEvery, Latest: s == VersionLatest, }, nil } case srcType.Kind() == reflect.Map: version := Version{} if versionConfig, ok := data.(map[interface{}]interface{}); ok { for key, val := range versionConfig { if sKey, ok := key.(string); ok { if sVal, ok := val.(string); ok { version[sKey] = strings.TrimSpace(sVal) } } } return VersionConfig{ Pinned: version, }, nil } } return data, nil }
Functions ¶
This section is empty.
Types ¶
type AggregatePlan ¶
type AggregatePlan []Plan
func (AggregatePlan) Public ¶
func (plan AggregatePlan) Public() *json.RawMessage
type ArtifactOutputPlan ¶
type ArtifactOutputPlan struct {
Name string `json:"name"`
}
func (ArtifactOutputPlan) Public ¶
func (plan ArtifactOutputPlan) Public() *json.RawMessage
type Build ¶
type Build struct { ID int `json:"id"` TeamName string `json:"team_name"` Name string `json:"name"` Status string `json:"status"` JobName string `json:"job_name,omitempty"` APIURL string `json:"api_url"` PipelineName string `json:"pipeline_name,omitempty"` StartTime int64 `json:"start_time,omitempty"` EndTime int64 `json:"end_time,omitempty"` ReapTime int64 `json:"reap_time,omitempty"` }
type BuildInput ¶
type BuildInputsOutputs ¶
type BuildInputsOutputs struct { Inputs []PublicBuildInput `json:"inputs"` Outputs []VersionedResource `json:"outputs"` }
type BuildPreparation ¶
type BuildPreparation struct { BuildID int `json:"build_id"` PausedPipeline BuildPreparationStatus `json:"paused_pipeline"` PausedJob BuildPreparationStatus `json:"paused_job"` MaxRunningBuilds BuildPreparationStatus `json:"max_running_builds"` Inputs map[string]BuildPreparationStatus `json:"inputs"` InputsSatisfied BuildPreparationStatus `json:"inputs_satisfied"` MissingInputReasons MissingInputReasons `json:"missing_input_reasons"` }
type BuildPreparationStatus ¶
type BuildPreparationStatus string
const ( BuildPreparationStatusUnknown BuildPreparationStatus = "unknown" BuildPreparationStatusBlocking BuildPreparationStatus = "blocking" BuildPreparationStatusNotBlocking BuildPreparationStatus = "not_blocking" )
type BuildStatus ¶
type BuildStatus string
const ( StatusStarted BuildStatus = "started" StatusPending BuildStatus = "pending" StatusSucceeded BuildStatus = "succeeded" StatusFailed BuildStatus = "failed" StatusErrored BuildStatus = "errored" StatusAborted BuildStatus = "aborted" )
type CacheConfig ¶
type CacheConfig struct {
Path string `json:"path,omitempty" yaml:"path,omitempty" mapstructure:"path"`
}
type Cause ¶
type Cause struct { VersionedResource VersionedResource Build Build }
type CheckRequestBody ¶
type CheckRequestBody struct {
From Version `json:"from"`
}
type CheckResponseBody ¶
type ClearTaskCacheResponse ¶
type ClearTaskCacheResponse struct {
CachesRemoved int64 `json:"caches_removed"`
}
type Config ¶
type Config struct { Groups GroupConfigs `yaml:"groups" json:"groups" mapstructure:"groups"` Resources ResourceConfigs `yaml:"resources" json:"resources" mapstructure:"resources"` ResourceTypes ResourceTypes `yaml:"resource_types" json:"resource_types" mapstructure:"resource_types"` Jobs JobConfigs `yaml:"jobs" json:"jobs" mapstructure:"jobs"` }
type ConfigResponse ¶
type Container ¶
type Container struct { ID string `json:"id"` WorkerName string `json:"worker_name"` State string `json:"state,omitempty"` Type string `json:"type,omitempty"` StepName string `json:"step_name,omitempty"` Attempt string `json:"attempt,omitempty"` PipelineID int `json:"pipeline_id,omitempty"` JobID int `json:"job_id,omitempty"` BuildID int `json:"build_id,omitempty"` ResourceID int `json:"resource_id,omitempty"` ResourceTypeID int `json:"resource_type_id,omitempty"` PipelineName string `json:"pipeline_name,omitempty"` JobName string `json:"job_name,omitempty"` BuildName string `json:"build_name,omitempty"` ResourceName string `json:"resource_name,omitempty"` ResourceTypeName string `json:"resource_type_name,omitempty"` User string `json:"user,omitempty"` WorkingDirectory string `json:"working_directory,omitempty"` }
type ContainerLimits ¶
type ContainerLimits struct { CPU *uint64 `yaml:"cpu,omitempty" json:"cpu,omitempty" mapstructure:"cpu"` Memory *uint64 `yaml:"memory,omitempty" json:"memory,omitempty" mapstructure:"memory"` }
func (*ContainerLimits) UnmarshalJSON ¶
func (c *ContainerLimits) UnmarshalJSON(limit []byte) error
func (*ContainerLimits) UnmarshalYAML ¶
func (c *ContainerLimits) UnmarshalYAML(unmarshal func(interface{}) error) error
type DependentGetPlan ¶
type DependentGetPlan struct { Type string `json:"type"` Name string `json:"name,omitempty"` Resource string `json:"resource"` }
func (DependentGetPlan) Public ¶
func (plan DependentGetPlan) Public() *json.RawMessage
type DoPlan ¶
type DoPlan []Plan
func (DoPlan) Public ¶
func (plan DoPlan) Public() *json.RawMessage
type EnsurePlan ¶
func (EnsurePlan) Public ¶
func (plan EnsurePlan) Public() *json.RawMessage
type Event ¶
type Event interface { EventType() EventType Version() EventVersion }
type EventVersion ¶
type EventVersion string
semantic version for an individual event.
minor bumps are expected to be backwards-compatible, meaning clients can interpret them via the older handlers, and they can unmarshal into the new version trivially.
ATC will always emit the highest possible minor version for an event. this is so that we don't have to maintain copies of the event every time there's a minor bump.
an example of a minor bump would be an additive change, i.e. a new field.
major bumps are backwards-incompatible.
an example of a major bump would be the changing or removal of a field.
type GetPlan ¶
type GetPlan struct { Type string `json:"type"` Name string `json:"name,omitempty"` Resource string `json:"resource"` Source Source `json:"source"` Params Params `json:"params,omitempty"` Version *Version `json:"version,omitempty"` VersionFrom *PlanID `json:"version_from,omitempty"` Tags Tags `json:"tags,omitempty"` VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"` }
func (GetPlan) Public ¶
func (plan GetPlan) Public() *json.RawMessage
type GroupConfig ¶
type GroupConfigs ¶
type GroupConfigs []GroupConfig
func (GroupConfigs) Lookup ¶
func (groups GroupConfigs) Lookup(name string) (GroupConfig, bool)
type HijackInput ¶
type HijackInput struct { Closed bool `json:"closed,omitempty"` Stdin []byte `json:"stdin,omitempty"` TTYSpec *HijackTTYSpec `json:"tty,omitempty"` }
type HijackOutput ¶
type HijackProcessSpec ¶
type HijackTTYSpec ¶
type HijackTTYSpec struct {
WindowSize HijackWindowSize `json:"window_size"`
}
type HijackWindowSize ¶
type Hooks ¶
type Hooks struct { Abort *PlanConfig Failure *PlanConfig Ensure *PlanConfig Success *PlanConfig }
type ImageResource ¶
type ImageResource struct { Type string `yaml:"type" json:"type" mapstructure:"type"` Source Source `yaml:"source" json:"source" mapstructure:"source"` Params *Params `yaml:"params,omitempty" json:"params,omitempty" mapstructure:"params"` Version *Version `yaml:"version,omitempty" json:"version,omitempty" mapstructure:"version"` }
type Job ¶
type Job struct { ID int `json:"id"` Name string `json:"name"` PipelineName string `json:"pipeline_name"` TeamName string `json:"team_name"` Paused bool `json:"paused,omitempty"` FirstLoggedBuildID int `json:"first_logged_build_id,omitempty"` DisableManualTrigger bool `json:"disable_manual_trigger,omitempty"` NextBuild *Build `json:"next_build"` FinishedBuild *Build `json:"finished_build"` TransitionBuild *Build `json:"transition_build,omitempty"` Inputs []JobInput `json:"inputs"` Outputs []JobOutput `json:"outputs"` Groups []string `json:"groups"` }
type JobConfig ¶
type JobConfig struct { Name string `yaml:"name" json:"name" mapstructure:"name"` Public bool `yaml:"public,omitempty" json:"public,omitempty" mapstructure:"public"` DisableManualTrigger bool `yaml:"disable_manual_trigger,omitempty" json:"disable_manual_trigger,omitempty" mapstructure:"disable_manual_trigger"` Serial bool `yaml:"serial,omitempty" json:"serial,omitempty" mapstructure:"serial"` Interruptible bool `yaml:"interruptible,omitempty" json:"interruptible,omitempty" mapstructure:"interruptible"` SerialGroups []string `yaml:"serial_groups,omitempty" json:"serial_groups,omitempty" mapstructure:"serial_groups"` RawMaxInFlight int `yaml:"max_in_flight,omitempty" json:"max_in_flight,omitempty" mapstructure:"max_in_flight"` BuildLogsToRetain int `yaml:"build_logs_to_retain,omitempty" json:"build_logs_to_retain,omitempty" mapstructure:"build_logs_to_retain"` Plan PlanSequence `yaml:"plan,omitempty" json:"plan,omitempty" mapstructure:"plan"` Abort *PlanConfig `yaml:"on_abort,omitempty" json:"on_abort,omitempty" mapstructure:"on_abort"` Failure *PlanConfig `yaml:"on_failure,omitempty" json:"on_failure,omitempty" mapstructure:"on_failure"` Ensure *PlanConfig `yaml:"ensure,omitempty" json:"ensure,omitempty" mapstructure:"ensure"` Success *PlanConfig `yaml:"on_success,omitempty" json:"on_success,omitempty" mapstructure:"on_success"` }
func (JobConfig) GetSerialGroups ¶
func (JobConfig) InputPlans ¶
func (config JobConfig) InputPlans() []PlanConfig
func (JobConfig) MaxInFlight ¶
func (JobConfig) OutputPlans ¶
func (config JobConfig) OutputPlans() []PlanConfig
func (JobConfig) Plans ¶
func (config JobConfig) Plans() []PlanConfig
type JobConfigs ¶
type JobConfigs []JobConfig
type MalformedConfigError ¶
type MalformedConfigError struct {
UnmarshalError error
}
func (MalformedConfigError) Error ¶
func (malformedConfigError MalformedConfigError) Error() string
type MetadataField ¶
type MissingInputReasons ¶
type OnAbortPlan ¶
func (OnAbortPlan) Public ¶
func (plan OnAbortPlan) Public() *json.RawMessage
type OnFailurePlan ¶
func (OnFailurePlan) Public ¶
func (plan OnFailurePlan) Public() *json.RawMessage
type OnSuccessPlan ¶
func (OnSuccessPlan) Public ¶
func (plan OnSuccessPlan) Public() *json.RawMessage
type Plan ¶
type Plan struct { ID PlanID `json:"id"` Attempts []int `json:"attempts,omitempty"` Aggregate *AggregatePlan `json:"aggregate,omitempty"` Do *DoPlan `json:"do,omitempty"` Get *GetPlan `json:"get,omitempty"` Put *PutPlan `json:"put,omitempty"` Task *TaskPlan `json:"task,omitempty"` OnAbort *OnAbortPlan `json:"on_abort,ommitempty"` Ensure *EnsurePlan `json:"ensure,omitempty"` OnSuccess *OnSuccessPlan `json:"on_success,omitempty"` OnFailure *OnFailurePlan `json:"on_failure,omitempty"` Try *TryPlan `json:"try,omitempty"` Timeout *TimeoutPlan `json:"timeout,omitempty"` Retry *RetryPlan `json:"retry,omitempty"` // used for 'fly execute' UserArtifact *UserArtifactPlan `json:"user_artifact,omitempty"` ArtifactOutput *ArtifactOutputPlan `json:"artifact_output,omitempty"` // deprecated, kept for backwards compatibility to be able to show old builds DependentGet *DependentGetPlan `json:"dependent_get,omitempty"` }
func (Plan) Public ¶
func (plan Plan) Public() *json.RawMessage
type PlanConfig ¶
type PlanConfig struct { // compose a nested sequence of plans // name of the nested 'do' RawName string `yaml:"name,omitempty" json:"name,omitempty" mapstructure:"name"` // a nested chain of steps to run Do *PlanSequence `yaml:"do,omitempty" json:"do,omitempty" mapstructure:"do"` // corresponds to an Aggregate plan, keyed by the name of each sub-plan Aggregate *PlanSequence `yaml:"aggregate,omitempty" json:"aggregate,omitempty" mapstructure:"aggregate"` // corresponds to Get and Put resource plans, respectively // name of 'input', e.g. bosh-stemcell Get string `yaml:"get,omitempty" json:"get,omitempty" mapstructure:"get"` // jobs that this resource must have made it through Passed []string `yaml:"passed,omitempty" json:"passed,omitempty" mapstructure:"passed"` // whether to trigger based on this resource changing Trigger bool `yaml:"trigger,omitempty" json:"trigger,omitempty" mapstructure:"trigger"` // name of 'output', e.g. rootfs-tarball Put string `yaml:"put,omitempty" json:"put,omitempty" mapstructure:"put"` // corresponding resource config, e.g. aws-stemcell Resource string `yaml:"resource,omitempty" json:"resource,omitempty" mapstructure:"resource"` // corresponds to a Task plan // name of 'task', e.g. unit, go1.3, go1.4 Task string `yaml:"task,omitempty" json:"task,omitempty" mapstructure:"task"` // run task privileged Privileged bool `yaml:"privileged,omitempty" json:"privileged,omitempty" mapstructure:"privileged"` // task config path, e.g. foo/build.yml TaskConfigPath string `yaml:"file,omitempty" json:"file,omitempty" mapstructure:"file"` // inlined task config TaskConfig *TaskConfig `yaml:"config,omitempty" json:"config,omitempty" mapstructure:"config"` // used by Get and Put for specifying params to the resource Params Params `yaml:"params,omitempty" json:"params,omitempty" mapstructure:"params"` // used to pass specific inputs/outputs as generic inputs/outputs in task config InputMapping map[string]string `yaml:"input_mapping,omitempty" json:"input_mapping,omitempty" mapstructure:"input_mapping"` OutputMapping map[string]string `yaml:"output_mapping,omitempty" json:"output_mapping,omitempty" mapstructure:"output_mapping"` // used to specify an image artifact from a previous build to be used as the image for a subsequent task container ImageArtifactName string `yaml:"image,omitempty" json:"image,omitempty" mapstructure:"image"` // used by Put to specify params for the subsequent Get GetParams Params `yaml:"get_params,omitempty" json:"get_params,omitempty" mapstructure:"get_params"` // used by any step to specify which workers are eligible to run the step Tags Tags `yaml:"tags,omitempty" json:"tags,omitempty" mapstructure:"tags"` // used by any step to run something when the build is aborted during execution of the step Abort *PlanConfig `yaml:"on_abort,omitempty" json:"on_abort,omitempty" mapstructure:"on_abort"` // used by any step to run something when the step reports a failure Failure *PlanConfig `yaml:"on_failure,omitempty" json:"on_failure,omitempty" mapstructure:"on_failure"` // used on any step to always execute regardless of the step's completed state Ensure *PlanConfig `yaml:"ensure,omitempty" json:"ensure,omitempty" mapstructure:"ensure"` // used on any step to execute on successful completion of the step Success *PlanConfig `yaml:"on_success,omitempty" json:"on_success,omitempty" mapstructure:"on_success"` // used on any step to swallow failures and errors Try *PlanConfig `yaml:"try,omitempty" json:"try,omitempty" mapstructure:"try"` // used on any step to interrupt the step after a given duration Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty" mapstructure:"timeout"` // not present in yaml DependentGet string `yaml:"-" json:"-"` // repeat the step up to N times, until it works Attempts int `yaml:"attempts,omitempty" json:"attempts,omitempty" mapstructure:"attempts"` Version *VersionConfig `yaml:"version,omitempty" json:"version,omitempty" mapstructure:"version"` }
A PlanConfig is a flattened set of configuration corresponding to a particular Plan, where Source and Version are populated lazily.
func (PlanConfig) Hooks ¶
func (config PlanConfig) Hooks() Hooks
func (PlanConfig) Name ¶
func (config PlanConfig) Name() string
func (PlanConfig) ResourceName ¶
func (config PlanConfig) ResourceName() string
type PlanFactory ¶
type PlanFactory struct {
// contains filtered or unexported fields
}
func NewPlanFactory ¶
func NewPlanFactory(startingNum int64) PlanFactory
func (PlanFactory) NewPlan ¶
func (factory PlanFactory) NewPlan(step Step) Plan
type PlanSequence ¶
type PlanSequence []PlanConfig
A PlanSequence corresponds to a chain of Compose plan, with an implicit `on: [success]` after every Task plan.
type PruneWorkerResponseBody ¶
type PruneWorkerResponseBody struct {
Stderr string `json:"stderr"`
}
type PublicBuildInput ¶
type PublicBuildPlan ¶
type PublicBuildPlan struct { Schema string `json:"schema"` Plan *json.RawMessage `json:"plan"` }
type PutPlan ¶
type PutPlan struct { Type string `json:"type"` Name string `json:"name,omitempty"` Resource string `json:"resource"` Source Source `json:"source"` Params Params `json:"params,omitempty"` Tags Tags `json:"tags,omitempty"` VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"` }
func (PutPlan) Public ¶
func (plan PutPlan) Public() *json.RawMessage
type RenameRequest ¶
type RenameRequest struct {
NewName string `json:"name"`
}
type Resource ¶
type Resource struct { Name string `json:"name"` PipelineName string `json:"pipeline_name"` TeamName string `json:"team_name"` Type string `json:"type"` LastChecked int64 `json:"last_checked,omitempty"` Paused bool `json:"paused,omitempty"` FailingToCheck bool `json:"failing_to_check,omitempty"` CheckError string `json:"check_error,omitempty"` }
type ResourceConfig ¶
type ResourceConfig struct { Name string `yaml:"name" json:"name" mapstructure:"name"` WebhookToken string `yaml:"webhook_token,omitempty" json:"webhook_token" mapstructure:"webhook_token"` Type string `yaml:"type" json:"type" mapstructure:"type"` Source Source `yaml:"source" json:"source" mapstructure:"source"` CheckEvery string `yaml:"check_every,omitempty" json:"check_every" mapstructure:"check_every"` CheckTimeout string `yaml:"check_timeout,omitempty" json:"check_timeout" mapstructure:"check_timeout"` Tags Tags `yaml:"tags,omitempty" json:"tags" mapstructure:"tags"` Version Version `yaml:"version,omitempty" json:"version" mapstructure:"version"` }
type ResourceConfigs ¶
type ResourceConfigs []ResourceConfig
func (ResourceConfigs) Lookup ¶
func (resources ResourceConfigs) Lookup(name string) (ResourceConfig, bool)
type ResourceType ¶
type ResourceType struct { Name string `yaml:"name" json:"name" mapstructure:"name"` Type string `yaml:"type" json:"type" mapstructure:"type"` Source Source `yaml:"source" json:"source" mapstructure:"source"` Privileged bool `yaml:"privileged,omitempty" json:"privileged" mapstructure:"privileged"` CheckEvery string `yaml:"check_every,omitempty" json:"check_every" mapstructure:"check_every"` Tags Tags `yaml:"tags,omitempty" json:"tags" mapstructure:"tags"` Params Params `yaml:"params,omitempty" json:"params" mapstructure:"params"` }
type ResourceTypes ¶
type ResourceTypes []ResourceType
func (ResourceTypes) Lookup ¶
func (types ResourceTypes) Lookup(name string) (ResourceType, bool)
func (ResourceTypes) Without ¶
func (types ResourceTypes) Without(name string) ResourceTypes
type RetryPlan ¶
type RetryPlan []Plan
func (RetryPlan) Public ¶
func (plan RetryPlan) Public() *json.RawMessage
type Step ¶
type Step interface {
Public() *json.RawMessage
}
type TaskConfig ¶
type TaskConfig struct { // The platform the task must run on (e.g. linux, windows). Platform string `json:"platform,omitempty" yaml:"platform,omitempty" mapstructure:"platform"` // Optional string specifying an image to use for the build. Depending on the // platform, this may or may not be required (e.g. Windows/OS X vs. Linux). RootfsURI string `json:"rootfs_uri,omitempty" yaml:"rootfs_uri,omitempty" mapstructure:"rootfs_uri"` ImageResource *ImageResource `json:"image_resource,omitempty" yaml:"image_resource,omitempty" mapstructure:"image_resource"` // Limits to set on the Task Container Limits ContainerLimits `json:"container_limits,omitempty" yaml:"container_limits,omitempty" mapstructure:"container_limits"` // Parameters to pass to the task via environment variables. Params map[string]string `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params"` // Script to execute. Run TaskRunConfig `json:"run,omitempty" yaml:"run,omitempty" mapstructure:"run"` // The set of (logical, name-only) inputs required by the task. Inputs []TaskInputConfig `json:"inputs,omitempty" yaml:"inputs,omitempty" mapstructure:"inputs"` // The set of (logical, name-only) outputs provided by the task. Outputs []TaskOutputConfig `json:"outputs,omitempty" yaml:"outputs,omitempty" mapstructure:"outputs"` // Path to cached directory that will be shared between builds for the same task. Caches []CacheConfig `json:"caches,omitempty" yaml:"caches,omitempty" mapstructure:"caches"` }
func NewTaskConfig ¶
func NewTaskConfig(configBytes []byte) (TaskConfig, error)
func (TaskConfig) Merge ¶
func (config TaskConfig) Merge(other TaskConfig) (TaskConfig, []string, error)
func (TaskConfig) Validate ¶
func (config TaskConfig) Validate() error
type TaskInputConfig ¶
type TaskOutputConfig ¶
type TaskPlan ¶
type TaskPlan struct { Name string `json:"name,omitempty"` Privileged bool `json:"privileged"` Tags Tags `json:"tags,omitempty"` ConfigPath string `json:"config_path,omitempty"` Config *TaskConfig `json:"config,omitempty"` Params Params `json:"params,omitempty"` InputMapping map[string]string `json:"input_mapping,omitempty"` OutputMapping map[string]string `json:"output_mapping,omitempty"` ImageArtifactName string `json:"image,omitempty"` VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"` }
func (TaskPlan) Public ¶
func (plan TaskPlan) Public() *json.RawMessage
type TaskRunConfig ¶
type TaskRunConfig struct { Path string `json:"path" yaml:"path"` Args []string `json:"args,omitempty" yaml:"args,omitempty"` Dir string `json:"dir,omitempty" yaml:"dir,omitempty"` // The user that the task will run as (defaults to whatever the docker image specifies) User string `json:"user,omitempty" yaml:"user,omitempty" mapstructure:"user"` }
type TimeoutPlan ¶
func (TimeoutPlan) Public ¶
func (plan TimeoutPlan) Public() *json.RawMessage
type TryPlan ¶
type TryPlan struct {
Step Plan `json:"step"`
}
func (TryPlan) Public ¶
func (plan TryPlan) Public() *json.RawMessage
type UserArtifactPlan ¶
type UserArtifactPlan struct {
Name string `json:"name"`
}
func (UserArtifactPlan) Public ¶
func (plan UserArtifactPlan) Public() *json.RawMessage
type VersionConfig ¶
type VersionConfig struct { Every bool `yaml:"every,omitempty" json:"every,omitempty"` Latest bool `yaml:"latest,omitempty" json:"latest,omitempty"` Pinned Version `yaml:"pinned,omitempty" json:"pinned,omitempty"` }
A VersionConfig represents the choice to include every version of a resource, the latest version of a resource, or a pinned (specific) one.
func (*VersionConfig) MarshalJSON ¶
func (c *VersionConfig) MarshalJSON() ([]byte, error)
func (*VersionConfig) MarshalYAML ¶
func (c *VersionConfig) MarshalYAML() (interface{}, error)
func (*VersionConfig) UnmarshalJSON ¶
func (c *VersionConfig) UnmarshalJSON(version []byte) error
func (*VersionConfig) UnmarshalYAML ¶
func (c *VersionConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type VersionedResource ¶
type VersionedResourceType ¶
type VersionedResourceType struct { ResourceType Version Version `yaml:"version" json:"version" mapstructure:"version"` }
type VersionedResourceTypes ¶
type VersionedResourceTypes []VersionedResourceType
func (VersionedResourceTypes) Lookup ¶
func (types VersionedResourceTypes) Lookup(name string) (VersionedResourceType, bool)
func (VersionedResourceTypes) Without ¶
func (types VersionedResourceTypes) Without(name string) VersionedResourceTypes
type Volume ¶
type Volume struct { ID string `json:"id"` WorkerName string `json:"worker_name"` Type string `json:"type"` ContainerHandle string `json:"container_handle"` Path string `json:"path"` ParentHandle string `json:"parent_handle"` ResourceType *VolumeResourceType `json:"resource_type"` BaseResourceType *VolumeBaseResourceType `json:"base_resource_type"` PipelineName string `json:"pipeline_name"` JobName string `json:"job_name"` StepName string `json:"step_name"` }
type VolumeBaseResourceType ¶
type VolumeResourceType ¶
type VolumeResourceType struct { ResourceType *VolumeResourceType `json:"resource_type"` BaseResourceType *VolumeBaseResourceType `json:"base_resource_type"` Version Version `json:"version"` }
type Worker ¶
type Worker struct { // not garden_addr, for backwards-compatibility GardenAddr string `json:"addr"` BaggageclaimURL string `json:"baggageclaim_url"` CertsPath *string `json:"certs_path,omitempty"` HTTPProxyURL string `json:"http_proxy_url,omitempty"` HTTPSProxyURL string `json:"https_proxy_url,omitempty"` NoProxy string `json:"no_proxy,omitempty"` ActiveContainers int `json:"active_containers"` ActiveVolumes int `json:"active_volumes"` ResourceTypes []WorkerResourceType `json:"resource_types"` Platform string `json:"platform"` Tags []string `json:"tags"` Team string `json:"team"` Name string `json:"name"` Version string `json:"version"` StartTime int64 `json:"start_time"` Ephemeral bool `json:"ephemeral"` State string `json:"state"` }
Source Files ¶
- build.go
- build_inputs_outputs.go
- cause.go
- config.go
- container.go
- container_limits_marshaller.go
- decode_hook.go
- errors.go
- event.go
- hijack_payload.go
- info.go
- job.go
- job_config.go
- log_level.go
- pagination.go
- path_flag.go
- pipe.go
- pipeline.go
- plan.go
- plan_factory.go
- public_build_plan.go
- public_plan.go
- resource.go
- resource_types.go
- resourcecheck.go
- responses.go
- routes.go
- task.go
- team.go
- validate.go
- versioned_resource_types.go
- volume.go
- worker.go
Directories ¶
Path | Synopsis |
---|---|
accessor/accessorfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
auth/authfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
containerserver/containerserverfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
jobserver/jobserverfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
resourceserver/resourceserverfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
buildsfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
cmd
|
|
credsfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
dbfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
encryption/encryptionfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
lock/lockfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
migration/migrationfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
enginefakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
execfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
gcfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
lockrunnerfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
metricfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
pipelinesfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
radarfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
resourcefakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
factory/factoryfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
inputmapper/inputconfig/inputconfigfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
inputmapper/inputmapperfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
maxinflight/maxinflightfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
schedulerfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
syslogfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
image/imagefakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
transport/transportfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
workerfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
wrappafakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |