Documentation ¶
Overview ¶
Package yaml provides the defined yaml types for Vela.
Usage:
import "github.com/go-vela/types/yaml"
Index ¶
- type Build
- type CancelOptions
- type Metadata
- type Origin
- type Rules
- type Ruleset
- type Secret
- type SecretSlice
- type Service
- type ServiceSlice
- type Stage
- type StageSlice
- type Step
- type StepSecret
- type StepSecretSlice
- type StepSlice
- type StepTemplate
- type Template
- type TemplateSlice
- type Ulimit
- type UlimitSlice
- type Volume
- type VolumeSlice
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { Version string `` /* 219-byte string literal not displayed */ Metadata Metadata `` /* 169-byte string literal not displayed */ Environment raw.StringSliceMap `` /* 245-byte string literal not displayed */ Worker Worker `` /* 189-byte string literal not displayed */ Secrets SecretSlice `` /* 174-byte string literal not displayed */ Services ServiceSlice `` /* 197-byte string literal not displayed */ Stages StageSlice `` /* 204-byte string literal not displayed */ Steps StepSlice `` /* 203-byte string literal not displayed */ Templates TemplateSlice `` /* 188-byte string literal not displayed */ }
Build is the yaml representation of a build for a pipeline.
func (*Build) ToPipelineLibrary ¶ added in v0.14.0
ToPipelineLibrary converts the Build type to a library Pipeline type.
func (*Build) UnmarshalYAML ¶ added in v0.13.0
UnmarshalYAML implements the Unmarshaler interface for the Build type.
type CancelOptions ¶ added in v0.22.0
type CancelOptions struct { Running *bool `` /* 241-byte string literal not displayed */ Pending *bool `` /* 240-byte string literal not displayed */ DefaultBranch *bool `` /* 283-byte string literal not displayed */ }
CancelOptions is the yaml representation of the auto_cancel block for a pipeline.
type Metadata ¶
type Metadata struct { Template bool `` /* 207-byte string literal not displayed */ RenderInline bool `` /* 229-byte string literal not displayed */ Clone *bool `` /* 210-byte string literal not displayed */ Environment []string `` /* 236-byte string literal not displayed */ AutoCancel *CancelOptions `` /* 259-byte string literal not displayed */ }
Metadata is the yaml representation of the metadata block for a pipeline.
func (*Metadata) HasEnvironment ¶ added in v0.9.0
HasEnvironment checks if the container type is contained within the environment list.
func (*Metadata) ToPipeline ¶
ToPipeline converts the Metadata type to a pipeline Metadata type.
type Origin ¶ added in v0.5.0
type Origin struct { Environment raw.StringSliceMap `` /* 219-byte string literal not displayed */ Image string `` /* 231-byte string literal not displayed */ Name string `` /* 209-byte string literal not displayed */ Parameters map[string]interface{} `` /* 218-byte string literal not displayed */ Secrets StepSecretSlice `` /* 221-byte string literal not displayed */ Pull string `` /* 292-byte string literal not displayed */ Ruleset Ruleset `` /* 211-byte string literal not displayed */ }
Origin is the yaml representation of a method for looking up secrets with a secret plugin.
func (*Origin) MergeEnv ¶ added in v0.7.3
MergeEnv takes a list of environment variables and attempts to set them in the secret environment. If the environment variable already exists in the secret, than this will overwrite the existing environment variable.
func (*Origin) ToPipeline ¶ added in v0.5.0
ToPipeline converts the Origin type to a pipeline Container type.
type Rules ¶
type Rules struct { Branch []string `` /* 218-byte string literal not displayed */ Comment []string `` /* 227-byte string literal not displayed */ Event []string `` /* 215-byte string literal not displayed */ Path []string `` /* 231-byte string literal not displayed */ Repo []string `` /* 207-byte string literal not displayed */ Status []string `` /* 248-byte string literal not displayed */ Tag []string `` /* 221-byte string literal not displayed */ Target []string `` /* 228-byte string literal not displayed */ }
Rules is the yaml representation of the ruletypes from a ruleset block for a step in a pipeline.
func (*Rules) ToPipeline ¶
ToPipeline converts the Rules type to a pipeline Rules type.
func (*Rules) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaler interface for the Rules type.
type Ruleset ¶
type Ruleset struct { If Rules `` /* 192-byte string literal not displayed */ Unless Rules `` /* 203-byte string literal not displayed */ Matcher string `` /* 175-byte string literal not displayed */ Operator string `` /* 251-byte string literal not displayed */ Continue bool `` /* 232-byte string literal not displayed */ }
Ruleset is the yaml representation of a ruleset block for a step in a pipeline.
func (*Ruleset) ToPipeline ¶
ToPipeline converts the Ruleset type to a pipeline Ruleset type.
func (*Ruleset) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaler interface for the Ruleset type.
type Secret ¶
type Secret struct { Name string `` /* 216-byte string literal not displayed */ Key string `` /* 206-byte string literal not displayed */ Engine string `` /* 238-byte string literal not displayed */ Type string `` /* 240-byte string literal not displayed */ Origin Origin `` /* 218-byte string literal not displayed */ Pull string `` /* 249-byte string literal not displayed */ }
Secret is the yaml representation of a secret from the secrets block for a pipeline.
type SecretSlice ¶
type SecretSlice []*Secret
SecretSlice is the yaml representation of the secrets block for a pipeline.
func (*SecretSlice) ToPipeline ¶
func (s *SecretSlice) ToPipeline() *pipeline.SecretSlice
ToPipeline converts the SecretSlice type to a pipeline SecretSlice type.
func (*SecretSlice) UnmarshalYAML ¶
func (s *SecretSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the SecretSlice type.
type Service ¶
type Service struct { Image string `` /* 228-byte string literal not displayed */ Name string `` /* 230-byte string literal not displayed */ Entrypoint raw.StringSlice `` /* 210-byte string literal not displayed */ Environment raw.StringSliceMap `` /* 222-byte string literal not displayed */ Ports raw.StringSlice `` /* 214-byte string literal not displayed */ Pull string `` /* 294-byte string literal not displayed */ Ulimits UlimitSlice `` /* 201-byte string literal not displayed */ User string `` /* 185-byte string literal not displayed */ }
Service is the yaml representation of a Service in a pipeline.
type ServiceSlice ¶
type ServiceSlice []*Service
ServiceSlice is the yaml representation of the Services block for a pipeline.
func (*ServiceSlice) ToPipeline ¶
func (s *ServiceSlice) ToPipeline() *pipeline.ContainerSlice
ToPipeline converts the ServiceSlice type to a pipeline ContainerSlice type.
func (*ServiceSlice) UnmarshalYAML ¶
func (s *ServiceSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the ServiceSlice type.
type Stage ¶
type Stage struct { Environment raw.StringSliceMap `` /* 239-byte string literal not displayed */ Name string `` /* 222-byte string literal not displayed */ Needs raw.StringSlice `` /* 221-byte string literal not displayed */ Independent bool `` /* 133-byte string literal not displayed */ Steps StepSlice `` /* 220-byte string literal not displayed */ }
Stage is the yaml representation of a stage in a pipeline.
type StageSlice ¶
type StageSlice []*Stage
StageSlice is the yaml representation of the stages block for a pipeline.
func (StageSlice) MarshalYAML ¶ added in v0.7.3
func (s StageSlice) MarshalYAML() (interface{}, error)
MarshalYAML implements the marshaler interface for the StageSlice type.
func (*StageSlice) ToPipeline ¶
func (s *StageSlice) ToPipeline() *pipeline.StageSlice
ToPipeline converts the StageSlice type to a pipeline StageSlice type.
func (*StageSlice) UnmarshalYAML ¶
func (s *StageSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the StageSlice type.
type Step ¶
type Step struct { Ruleset Ruleset `` /* 211-byte string literal not displayed */ Commands raw.StringSlice `` /* 213-byte string literal not displayed */ Entrypoint raw.StringSlice `` /* 206-byte string literal not displayed */ Secrets StepSecretSlice `` /* 220-byte string literal not displayed */ Template StepTemplate `` /* 229-byte string literal not displayed */ Ulimits UlimitSlice `` /* 198-byte string literal not displayed */ Volumes VolumeSlice `` /* 191-byte string literal not displayed */ Image string `` /* 243-byte string literal not displayed */ Name string `` /* 200-byte string literal not displayed */ Pull string `` /* 292-byte string literal not displayed */ Environment raw.StringSliceMap `` /* 238-byte string literal not displayed */ Parameters map[string]interface{} `` /* 209-byte string literal not displayed */ Detach bool `` /* 207-byte string literal not displayed */ Privileged bool `` /* 206-byte string literal not displayed */ User string `` /* 185-byte string literal not displayed */ }
Step is the yaml representation of a step from the steps block for a pipeline.
type StepSecret ¶
type StepSecret struct { Source string `yaml:"source,omitempty"` Target string `yaml:"target,omitempty"` }
StepSecret is the yaml representation of a secret from a secrets block for a step in a pipeline.
type StepSecretSlice ¶
type StepSecretSlice []*StepSecret
StepSecretSlice is the yaml representation of the secrets block for a step in a pipeline.
func (*StepSecretSlice) ToPipeline ¶
func (s *StepSecretSlice) ToPipeline() *pipeline.StepSecretSlice
ToPipeline converts the StepSecretSlice type to a pipeline StepSecretSlice type.
func (*StepSecretSlice) UnmarshalYAML ¶
func (s *StepSecretSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the StepSecretSlice type.
type StepSlice ¶
type StepSlice []*Step
StepSlice is the yaml representation of the steps block for a pipeline.
func (*StepSlice) ToPipeline ¶
func (s *StepSlice) ToPipeline() *pipeline.ContainerSlice
ToPipeline converts the StepSlice type to a pipeline ContainerSlice type.
func (*StepSlice) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaler interface for the StepSlice type.
type StepTemplate ¶
type StepTemplate struct { Name string `` /* 207-byte string literal not displayed */ Variables map[string]interface{} `` /* 188-byte string literal not displayed */ }
StepTemplate is the yaml representation of the template block for a step in a pipeline.
type Template ¶
type Template struct { Name string `` /* 210-byte string literal not displayed */ Source string `` /* 212-byte string literal not displayed */ Format string `` /* 253-byte string literal not displayed */ Type string `` /* 229-byte string literal not displayed */ Variables map[string]interface{} `` /* 195-byte string literal not displayed */ }
Template is the yaml representation of a template from the templates block for a pipeline.
func TemplateFromLibrary ¶ added in v0.7.0
TemplateFromLibrary converts the library Template type to a yaml Template type.
type TemplateSlice ¶
type TemplateSlice []*Template
TemplateSlice is the yaml representation of the templates block for a pipeline.
func (*TemplateSlice) Map ¶ added in v0.7.0
func (t *TemplateSlice) Map() map[string]*Template
Map helper function that creates a map of templates from a slice of templates.
func (*TemplateSlice) UnmarshalYAML ¶
func (t *TemplateSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the TemplateSlice type.
type Ulimit ¶
type Ulimit struct { Name string `` /* 201-byte string literal not displayed */ Soft int64 `` /* 169-byte string literal not displayed */ Hard int64 `` /* 169-byte string literal not displayed */ }
Ulimit is the yaml representation of a ulimit from the ulimits block for a step in a pipeline.
type UlimitSlice ¶
type UlimitSlice []*Ulimit
UlimitSlice is the yaml representation of the ulimits block for a step in a pipeline.
func (*UlimitSlice) ToPipeline ¶
func (u *UlimitSlice) ToPipeline() *pipeline.UlimitSlice
ToPipeline converts the UlimitSlice type to a pipeline UlimitSlice type.
func (*UlimitSlice) UnmarshalYAML ¶
func (u *UlimitSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the UlimitSlice type.
type Volume ¶
type Volume struct { Source string `` /* 218-byte string literal not displayed */ Destination string `` /* 245-byte string literal not displayed */ AccessMode string `` /* 217-byte string literal not displayed */ }
Volume is the yaml representation of a volume from a volumes block for a step in a pipeline.
type VolumeSlice ¶
type VolumeSlice []*Volume
VolumeSlice is the yaml representation of the volumes block for a step in a pipeline.
func (*VolumeSlice) ToPipeline ¶
func (v *VolumeSlice) ToPipeline() *pipeline.VolumeSlice
ToPipeline converts the VolumeSlice type to a pipeline VolumeSlice type.
func (*VolumeSlice) UnmarshalYAML ¶
func (v *VolumeSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the VolumeSlice type.
type Worker ¶ added in v0.2.0
type Worker struct { Flavor string `` /* 211-byte string literal not displayed */ Platform string `` /* 226-byte string literal not displayed */ }
Worker is the yaml representation of a worker from a worker block in a pipeline.
func (*Worker) ToPipeline ¶ added in v0.2.0
ToPipeline converts the Worker type to a pipeline Worker type.