yaml

package
v0.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Overview

Package yaml provides the defined yaml types for Vela.

Usage:

import "github.com/go-vela/types/yaml"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Version   string        `yaml:"version,omitempty"`
	Metadata  Metadata      `yaml:"metadata,omitempty"`
	Worker    Worker        `yaml:"worker,omitempty"`
	Secrets   SecretSlice   `yaml:"secrets,omitempty"`
	Services  ServiceSlice  `yaml:"services,omitempty"`
	Stages    StageSlice    `yaml:"stages,omitempty"`
	Steps     StepSlice     `yaml:"steps,omitempty"`
	Templates TemplateSlice `yaml:"templates,omitempty"`
}

Build is the yaml representation of a build for a pipeline.

type Metadata

type Metadata struct {
	Template bool `yaml:"template,omitempty"`
}

Metadata is the yaml representation of the metadata block for a pipeline.

func (*Metadata) ToPipeline

func (m *Metadata) ToPipeline() *pipeline.Metadata

ToPipeline converts the Metadata type to a pipeline Metadata type.

type Rules

type Rules struct {
	Branch []string `yaml:"branch,omitempty"`
	Event  []string `yaml:"event,omitempty"`
	Path   []string `yaml:"path,omitempty"`
	Repo   []string `yaml:"repo,omitempty"`
	Status []string `yaml:"status,omitempty"`
	Tag    []string `yaml:"tag,omitempty"`
}

Rules is the yaml representation of the ruletypes from a ruleset block for a step in a pipeline.

func (*Rules) ToPipeline

func (r *Rules) ToPipeline() *pipeline.Rules

ToPipeline converts the Rules type to a pipeline Rules type.

func (*Rules) UnmarshalYAML

func (r *Rules) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the Rules type.

type Ruleset

type Ruleset struct {
	If       Rules  `yaml:"if,omitempty"`
	Unless   Rules  `yaml:"unless,omitempty"`
	Operator string `yaml:"operator,omitempty"`
	Continue bool   `yaml:"continue,omitempty"`
}

Ruleset is the yaml representation of a ruleset block for a step in a pipeline.

func (*Ruleset) ToPipeline

func (r *Ruleset) ToPipeline() *pipeline.Ruleset

ToPipeline converts the Ruleset type to a pipeline Ruleset type.

func (*Ruleset) UnmarshalYAML

func (r *Ruleset) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the Ruleset type.

type Secret

type Secret struct {
	Name   string `yaml:"name,omitempty"`
	Key    string `yaml:"key,omitempty"`
	Engine string `yaml:"engine,omitempty"`
	Type   string `yaml:"type,omitempty"`
}

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             `yaml:"image,omitempty"`
	Name        string             `yaml:"name,omitempty"`
	Entrypoint  raw.StringSlice    `yaml:"entrypoint,omitempty"`
	Environment raw.StringSliceMap `yaml:"environment,omitempty"`
	Ports       raw.StringSlice    `yaml:"ports,omitempty"`
	Pull        bool               `yaml:"pull,omitempty"`
}

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 {
	Name  string          `yaml:"name,omitempty"`
	Needs raw.StringSlice `yaml:"needs,omitempty"`
	Steps StepSlice       `yaml:"steps,omitempty"`
}

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) 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 {
	Commands    raw.StringSlice        `yaml:"commands,omitempty"`
	Detach      bool                   `yaml:"detach,omitempty"`
	Entrypoint  raw.StringSlice        `yaml:"entrypoint,omitempty"`
	Environment raw.StringSliceMap     `yaml:"environment,omitempty"`
	Image       string                 `yaml:"image,omitempty"`
	Name        string                 `yaml:"name,omitempty"`
	Parameters  map[string]interface{} `yaml:"parameters,omitempty"`
	Privileged  bool                   `yaml:"privileged,omitempty"`
	Pull        bool                   `yaml:"pull,omitempty"`
	Ruleset     Ruleset                `yaml:"ruleset,omitempty"`
	Secrets     StepSecretSlice        `yaml:"secrets,omitempty"`
	Template    StepTemplate           `yaml:"template,omitempty"`
	Ulimits     UlimitSlice            `yaml:"ulimits,omitempty"`
	Volumes     VolumeSlice            `yaml:"volumes,omitempty"`
}

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

func (s *StepSlice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the StepSlice type.

type StepTemplate

type StepTemplate struct {
	Name      string                 `yaml:"name,omitempty"`
	Variables map[string]interface{} `yaml:"vars,omitempty"`
}

StepTemplate is the yaml representation of the template block for a step in a pipeline.

type Template

type Template struct {
	Name   string `yaml:"name,omitempty"`
	Source string `yaml:"source,omitempty"`
	Type   string `yaml:"type,omitempty"`
}

Template is the yaml representation of a template from the templates block for a pipeline.

type TemplateSlice

type TemplateSlice []*Template

TemplateSlice is the yaml representation of the templates block for a pipeline.

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 `yaml:"name,omitempty"`
	Soft int64  `yaml:"soft,omitempty"`
	Hard int64  `yaml:"hard,omitempty"`
}

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 `yaml:"source,omitempty"`
	Destination string `yaml:"destination,omitempty"`
	AccessMode  string `yaml:"access_mode,omitempty"`
}

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 `yaml:"flavor,omitempty"`
	Platform string `yaml:"platform,omitempty"`
}

Worker is the yaml representation of a worker from a worker block in a pipeline.

func (*Worker) ToPipeline added in v0.2.0

func (w *Worker) ToPipeline() *pipeline.Worker

ToPipeline converts the Worker type to a pipeline Worker type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL