turbine

package module
Version: v0.0.0-...-afaf855 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

README

= Turbine

Provides a stateless HTTP API to execute builds on a
https://github.com/cloudfoundry-incubator/garden[Garden] server.

Documentation

Index

Constants

View Source
const (
	ExecuteBuild     = "ExecuteBuild"
	DeleteBuild      = "DeleteBuild"
	AbortBuild       = "AbortBuild"
	HijackBuild      = "HijackBuild"
	GetBuildEvents   = "GetBuildEvents"
	CheckInput       = "CheckInput"
	CheckInputStream = "CheckInputStream"
)

Variables

View Source
var Routes = rata.Routes{
	{Path: "/builds", Method: "POST", Name: ExecuteBuild},
	{Path: "/builds/:guid", Method: "DELETE", Name: DeleteBuild},
	{Path: "/builds/:guid/abort", Method: "POST", Name: AbortBuild},
	{Path: "/builds/:guid/hijack", Method: "POST", Name: HijackBuild},
	{Path: "/builds/:guid/events", Method: "GET", Name: GetBuildEvents},
	{Path: "/checks", Method: "POST", Name: CheckInput},
	{Path: "/checks/stream", Method: "GET", Name: CheckInputStream},
}

Functions

This section is empty.

Types

type Build

type Build struct {
	Guid string `json:"guid"`

	Privileged bool `json:"privileged"`

	Config Config `json:"config"`

	Inputs  []Input  `json:"inputs"`
	Outputs []Output `json:"outputs"`
}

type Config

type Config struct {
	Image  string            `json:"image,omitempty"   yaml:"image"`
	Params map[string]string `json:"params,omitempty"  yaml:"params"`
	Run    RunConfig         `json:"run,omitempty"     yaml:"run"`
	Inputs []InputConfig     `json:"inputs,omitempty"  yaml:"inputs"`
}

func (Config) Merge

func (a Config) Merge(b Config) Config

type HijackPayload

type HijackPayload struct {
	Stdin   []byte
	TTYSpec *garden.TTYSpec
}

type Input

type Input struct {
	// logical name of the input with respect to the build's config
	Name string `json:"name"`

	// name of resource providing the input
	Resource string `json:"resource"`

	// type of resource
	Type string `json:"type"`

	// e.g. sha
	Version Version `json:"version,omitempty"`

	// e.g. git url, branch, private_key
	Source Source `json:"source,omitempty"`

	// arbitrary config for input
	Params Params `json:"params,omitempty"`

	// e.g. commit_author, commit_date
	Metadata []MetadataField `json:"metadata,omitempty"`

	// path to build configuration provided by this input
	ConfigPath string `json:"config_path"`
}

type InputConfig

type InputConfig struct {
	Name string `json:"name" yaml:"name"`
	Path string `json:"path,omitempty" yaml:"path"`
}

type MetadataField

type MetadataField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Output

type Output struct {
	Name string `json:"name"`

	Type string `json:"type"`

	// e.g. [success, failure]
	On OutputConditions `json:"on,omitempty"`

	// e.g. sha
	Version Version `json:"version,omitempty"`

	// e.g. git url, branch, private_key
	Source Source `json:"source,omitempty"`

	// arbitrary config for output
	Params Params `json:"params,omitempty"`

	// e.g. commit_author, commit_date, commit_sha
	Metadata []MetadataField `json:"metadata,omitempty"`
}

type OutputCondition

type OutputCondition string
const (
	OutputConditionSuccess OutputCondition = "success"
	OutputConditionFailure OutputCondition = "failure"
)

type OutputConditions

type OutputConditions []OutputCondition

func (OutputConditions) SatisfiedBy

func (cs OutputConditions) SatisfiedBy(exitStatus int) bool

type Params

type Params map[string]interface{}

type RunConfig

type RunConfig struct {
	Path string   `json:"path" yaml:"path"`
	Args []string `json:"args,omitempty" yaml:"args"`
}

type Source

type Source map[string]interface{}

type Status

type Status string
const (
	StatusStarted   Status = "started"
	StatusSucceeded Status = "succeeded"
	StatusFailed    Status = "failed"
	StatusErrored   Status = "errored"
	StatusAborted   Status = "aborted"
)

type Version

type Version map[string]interface{}

Directories

Path Synopsis
api
fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
inputs/fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
outputs/fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
cmd
fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
fakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
fakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL