Documentation
¶
Index ¶
- Constants
- type Configuration
- type ConfigurationVariable
- type ConfigurationVariableGenerator
- type ConfigurationVariableSlice
- type FlightStage
- type HealthCheck
- type Job
- type JobProperty
- type JobTemplate
- type Jobs
- type Package
- type Packages
- type Release
- type ReleaseConfig
- type ReleaseLicense
- type Role
- type RoleManifest
- type RoleRun
- type RoleRunExposedPort
- type RoleRunScaling
- type RoleRunVolume
- type RoleType
- type Roles
Constants ¶
const ( RoleTypeBoshTask = RoleType("bosh-task") // A role that is a BOSH task RoleTypeBosh = RoleType("bosh") // A role that is a BOSH job RoleTypeDocker = RoleType("docker") // A role that is a raw Docker image )
These are the types of roles available
const ( FlightStagePreFlight = FlightStage("pre-flight") // A role that runs before the main jobs start FlightStageFlight = FlightStage("flight") // A role that is a main job FlightStagePostFlight = FlightStage("post-flight") // A role that runs after the main jobs are up FlightStageManual = FlightStage("manual") // A role that only runs via user intervention )
These are the flight stages available
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Templates map[string]string `yaml:"templates"` Variables ConfigurationVariableSlice `yaml:"variables"` }
Configuration contains information about how to configure the resulting images
type ConfigurationVariable ¶
type ConfigurationVariable struct { Name string `yaml:"name"` Default interface{} `yaml:"default"` Description string `yaml:"description"` Generator *ConfigurationVariableGenerator `yaml:"generator"` }
ConfigurationVariable is a configuration to be exposed to the IaaS
type ConfigurationVariableGenerator ¶
type ConfigurationVariableGenerator struct { ID string `yaml:"id"` Type string `yaml:"type"` ValueType string `yaml:"value_type"` }
ConfigurationVariableGenerator describes how to automatically generate values for a configuration variable
type ConfigurationVariableSlice ¶
type ConfigurationVariableSlice []*ConfigurationVariable
ConfigurationVariableSlice is a sortable slice of ConfigurationVariables
func (ConfigurationVariableSlice) Len ¶
func (confVars ConfigurationVariableSlice) Len() int
Len is the number of ConfigurationVariables in the slice
func (ConfigurationVariableSlice) Less ¶
func (confVars ConfigurationVariableSlice) Less(i, j int) bool
Less reports whether config variable at index i sort before the one at index j
func (ConfigurationVariableSlice) Swap ¶
func (confVars ConfigurationVariableSlice) Swap(i, j int)
Swap exchanges configuration variables at index i and index j
type HealthCheck ¶
type HealthCheck struct { URL string `yaml:"url"` // URL for a HTTP GET to return 200~399. Cannot be used with other checks. Headers map[string]string `yaml:"headers"` // Custom headers; only used for URL. Command []string `yaml:"command"` // Custom command. Cannot be used with other checks. Port int32 `yaml:"port"` // Port for a TCP probe. Cannot be used with other checks. }
HealthCheck describes a non-standard health check endpoint
type Job ¶
type Job struct { Name string Description string Templates []*JobTemplate Packages Packages Path string Fingerprint string SHA1 string Properties []*JobProperty Version string Release *Release // contains filtered or unexported fields }
Job represents a BOSH job
func (*Job) Extract ¶
Extract will extract the contents of the job archive to destination It creates a directory with the name of the job Returns the full path of the extracted archive
func (*Job) MergeSpec ¶
MergeSpec is used to merge temporary spec patches into each job. otherJob should only be the hcf/patch-properties job. The code assumes package and property objects are immutable, as they're now being shared across jobs. Also, when specified packages or properties are specified in the "other" job, that one takes precedence.
func (*Job) ValidateSHA1 ¶
ValidateSHA1 validates that the SHA1 of the actual job archive is the same as the one from the release manifest
type JobProperty ¶
JobProperty is a generic key-value property referenced by a job
type JobTemplate ¶
JobTemplate represents a BOSH job template
type Jobs ¶
type Jobs []*Job
Jobs is an array of Job*
type Package ¶
type Package struct { Name string Version string Fingerprint string SHA1 string Release *Release Path string Dependencies Packages // contains filtered or unexported fields }
Package represents a BOSH package
func (*Package) Extract ¶
Extract will extract the contents of the package archive to destination It creates a directory with the name of the package Returns the full path of the extracted archive
func (*Package) GetPackageCompiledDir ¶
GetPackageCompiledDir returns the path to the build result directory of the package, underneath the main cache directory
func (*Package) GetPackageCompiledTempDir ¶
GetPackageCompiledTempDir returns the path to the build temp directory for the package, underneath the main cache directory
func (*Package) GetTargetPackageSourcesDir ¶
GetTargetPackageSourcesDir returns the path to the sources of the package, underneath the main cache directory
func (*Package) ValidateSHA1 ¶
ValidateSHA1 validates that the SHA1 of the actual package archive is the same as the one from the release manifest
type Packages ¶
type Packages []*Package
Packages is an array of *Package
type Release ¶
type Release struct { Jobs Jobs Packages Packages License ReleaseLicense Name string UncommittedChanges bool CommitHash string Version string Path string DevBOSHCacheDir string // contains filtered or unexported fields }
Release represents a BOSH release
func NewDevRelease ¶
NewDevRelease will create an instance of a BOSH development release
func (*Release) GetUniqueConfigs ¶
func (r *Release) GetUniqueConfigs() map[string]*ReleaseConfig
GetUniqueConfigs returns all unique configs available in a release
type ReleaseConfig ¶
ReleaseConfig is a global deployment configuration key
type ReleaseLicense ¶
type ReleaseLicense struct { // Files is a mapping of license file names to contents Files map[string][]byte // Release this license belongs to Release *Release }
ReleaseLicense represents the license of a BOSH release
type Role ¶
type Role struct { Name string `yaml:"name"` Jobs Jobs `yaml:"_,omitempty"` EnvironScripts []string `yaml:"environment_scripts"` Scripts []string `yaml:"scripts"` PostConfigScripts []string `yaml:"post_config_scripts"` Type RoleType `yaml:"type,omitempty"` JobNameList []*roleJob `yaml:"jobs"` Configuration *Configuration `yaml:"configuration"` Run *RoleRun `yaml:"run"` Tags []string `yaml:"tags"` // contains filtered or unexported fields }
Role represents a collection of jobs that are colocated on a container
func (*Role) GetRoleDevVersion ¶
GetRoleDevVersion gets the aggregate signature of all jobs and packages
func (*Role) GetScriptPaths ¶
GetScriptPaths returns the paths to the startup / post configgin scripts for a role
func (*Role) GetVariablesForRole ¶
func (r *Role) GetVariablesForRole() (ConfigurationVariableSlice, error)
GetVariablesForRole returns all the environment variables required for calculating all the templates for the role
type RoleManifest ¶
type RoleManifest struct { Roles Roles `yaml:"roles"` Configuration *Configuration `yaml:"configuration"` // contains filtered or unexported fields }
RoleManifest represents a collection of roles
func LoadRoleManifest ¶
func LoadRoleManifest(manifestFilePath string, releases []*Release, skipDev bool) (*RoleManifest, error)
LoadRoleManifest loads a yaml manifest that details how jobs get grouped into roles
func (*RoleManifest) GetRoleManifestDevPackageVersion ¶
func (m *RoleManifest) GetRoleManifestDevPackageVersion(extra string) string
GetRoleManifestDevPackageVersion gets the aggregate signature of all the packages
func (*RoleManifest) LookupRole ¶
func (m *RoleManifest) LookupRole(roleName string) *Role
LookupRole will find the given role in the role manifest
type RoleRun ¶
type RoleRun struct { Scaling *RoleRunScaling `yaml:"scaling"` Capabilities []string `yaml:"capabilities"` PersistentVolumes []*RoleRunVolume `yaml:"persistent-volumes"` Memory int `yaml:"memory"` VirtualCPUs int `yaml:"virtual-cpus"` ExposedPorts []*RoleRunExposedPort `yaml:"exposed-ports"` FlightStage FlightStage `yaml:"flight-stage"` HealthCheck *HealthCheck `yaml:"healthcheck,omitempty"` }
RoleRun describes how a role should behave at runtime
type RoleRunExposedPort ¶
type RoleRunExposedPort struct { Name string `yaml:"name"` Protocol string `yaml:"protocol"` External string `yaml:"external"` Internal string `yaml:"internal"` Public bool `yaml:"public"` }
RoleRunExposedPort describes a port to be available to other roles, or the outside world
type RoleRunScaling ¶
RoleRunScaling describes how a role should scale out at runtime
type RoleRunVolume ¶
type RoleRunVolume struct { Path string `yaml:"path"` Tag string `yaml:"tag"` Size int `yaml:"size"` }
RoleRunVolume describes a volume to be attached at runtime