config

package
v0.0.0-...-75e9695 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Comment   string
	Workflows []*Workflow
	Jobs      []*Job
	Orbs      []Orb
}

func (Config) String

func (c Config) String() string

func (Config) YamlNode

func (c Config) YamlNode() *yaml.Node

type Job

type Job struct {
	Name    string
	Comment string
	// The following two fields are mutually exclusive
	DockerImages     []string
	Executor         string
	WorkingDirectory string
	Steps            []Step
	Environment      map[string]string
}

Job definitions as they appear under config top-level "jobs:" key

func (Job) YamlNode

func (j Job) YamlNode() *yaml.Node

type Node

type Node interface {
	YamlNode() *yaml.Node
}

type Orb

type Orb struct {
	Name        string
	RegistryKey string
}

func (Orb) YamlNode

func (o Orb) YamlNode() *yaml.Node

type OrbCommandParameters

type OrbCommandParameters map[string]string

type Step

type Step struct {
	Type        StepType
	Comment     string
	Name        string // only used for run step
	Command     string // for run steps or orb-defined commands
	CacheKey    string
	Path        string               // cache, artifact or test results path
	Destination string               // artifact destination
	Parameters  OrbCommandParameters // for orb-defined steps
	When        WhenType
}

Step definitions for Jobs. Go has no sum types, so for now just throw all supported fields under one struct

func (Step) YamlNode

func (s Step) YamlNode() *yaml.Node

type StepType

type StepType uint32
const (
	Checkout StepType = iota
	Run
	SaveCache
	RestoreCache
	StoreArtifacts
	StoreTestResults
	OrbCommand
)

type WhenType

type WhenType uint32
const (
	WhenTypeUnused WhenType = iota
	WhenTypeOnSuccess
	WhenTypeOnFail
	WhenTypeAlways
)

func (WhenType) String

func (w WhenType) String() string

type Workflow

type Workflow struct {
	Name string
	Jobs []WorkflowJob
}

func (Workflow) YamlNode

func (w Workflow) YamlNode() *yaml.Node

type WorkflowJob

type WorkflowJob struct {
	Job          *Job
	Requires     []*Job
	CommentedOut bool
}

WorkflowJob are the references to the jobs that appear in the Workflow definitions For the actual job definitions (that appear under the top-level "jobs:" key) see Job type below

func (WorkflowJob) String

func (wj WorkflowJob) String() string

func (WorkflowJob) YamlNode

func (wj WorkflowJob) YamlNode() *yaml.Node

Jump to

Keyboard shortcuts

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