Documentation ¶
Overview ¶
Package manifest represents structure of a user entered YAML deployment manifest.
Index ¶
Constants ¶
View Source
const ( NetworkTypeManual = "manual" NetworkTypeLocal = "local" NetworkTypeDynamic = "dynamic" NetworkTypeVip = "vip" )
Variables ¶
View Source
var (
DefaultWatchTime = WatchTime{0, 60000}
)
View Source
var NetworkTypes = []string{NetworkTypeManual, NetworkTypeLocal, NetworkTypeDynamic, NetworkTypeVip}
Functions ¶
Types ¶
type Compilation ¶
type Compilation struct {
NetworkName string `yaml:"network"`
}
type Deployment ¶
type Deployment struct { Name string `yaml:"name"` Releases []Release `yaml:"releases"` Networks []Network `yaml:"networks"` Compilation Compilation `yaml:"compilation"` // Deployment-wide update config can be // overwritten by job-specific update config Update Update `yaml:"update"` Jobs []Job `yaml:"jobs"` // Global properties. // Non-raw field is populated by the validator. PropertiesRaw map[interface{}]interface{} `yaml:"properties"` Properties Properties }
func (Deployment) CanaryWatchTime ¶
func (d Deployment) CanaryWatchTime(job Job) WatchTime
func (Deployment) InstanceProperties ¶
func (d Deployment) InstanceProperties(job Job, i int) Properties
func (Deployment) InstanceWatchTime ¶
func (d Deployment) InstanceWatchTime(job Job, i int) WatchTime
func (Deployment) UpdateWatchTime ¶
func (d Deployment) UpdateWatchTime(job Job) WatchTime
type Job ¶
type Job struct { Name string `yaml:"name"` Instances int `yaml:"instances"` Update Update `yaml:"update"` // Deprecated in favor of Templates Template interface{} `yaml:"template"` Templates []Template `yaml:"templates"` // Job specific properties that override global properties. // Non-raw field is populated by the validator. PropertiesRaw map[interface{}]interface{} `yaml:"properties"` Properties Properties NetworkAssociations []NetworkAssociation `yaml:"networks"` }
type Manifest ¶
type Manifest struct {
Deployment Deployment
}
func NewManifestFromBytes ¶
NewManifestFromBytes returns manifest built from given bytes. Before returning manifest is syntactically validated.
func NewManifestFromPath ¶
func NewManifestFromPath(path string, fs boshsys.FileSystem) (Manifest, error)
NewManifestFromPath returns manifest read from the file system. Before returning manifest is syntactically validated.
type NetworkAssociation ¶
type Properties ¶
type Properties map[string]interface{}
type SyntaxValidator ¶
type SyntaxValidator struct {
// contains filtered or unexported fields
}
SyntaxValidator parses and saves all manifest values to determine their syntactic validity. Determining if individual values make sense in a greater context (within a deployment or a job) is outside of scope. e.g. - can watch time string value be parsed into a time range?
func NewSyntaxValidator ¶
func NewSyntaxValidator(manifest *Manifest) SyntaxValidator
func (SyntaxValidator) Validate ¶
func (v SyntaxValidator) Validate() error
type Update ¶
type Update struct { // Integer pointers to determine absence Canaries *int `yaml:"canaries"` MaxInFlight *int `yaml:"max_in_flight"` // String pointers to determine absence CanaryWatchTimeRaw *string `yaml:"canary_watch_time"` UpdateWatchTimeRaw *string `yaml:"update_watch_time"` // Populated by the validator CanaryWatchTime *WatchTime UpdateWatchTime *WatchTime }
Click to show internal directories.
Click to hide internal directories.