v1beta1

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Append

type Append struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Paths             []model.String `yaml:"paths"`
	With              model.String   `yaml:"with"`
	SkipEnsureNewline model.Bool     `yaml:"skip_ensure_newline"`
}

Append is an action that appends some output to the end of the file.

func (*Append) UnmarshalYAML

func (a *Append) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*Append) Validate

func (a *Append) Validate() error

Validate implements Validator.

type ForEach

type ForEach struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Iterator *ForEachIterator `yaml:"iterator"`
	Steps    []*Step          `yaml:"steps"`
}

func (*ForEach) UnmarshalYAML

func (f *ForEach) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*ForEach) Validate

func (f *ForEach) Validate() error

type ForEachIterator

type ForEachIterator struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	// The name by which the range value is accessed.
	Key model.String `yaml:"key"`

	// Values is a list to range over, e.g. ["dev", "prod"]
	Values []model.String `yaml:"values"`
	// ValuesFrom is a CEL expression returning a list of strings to range over.
	ValuesFrom *model.String `yaml:"values_from"`
}

func (*ForEachIterator) UnmarshalYAML

func (f *ForEachIterator) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*ForEachIterator) Validate

func (f *ForEachIterator) Validate() error

type GoTemplate

type GoTemplate struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Paths []model.String `yaml:"paths"`
}

GoTemplate is an action that executes one more files as a Go template, replacing each one with its template output.

func (*GoTemplate) UnmarshalYAML

func (g *GoTemplate) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*GoTemplate) Validate

func (g *GoTemplate) Validate() error

Validate implements Validator.

type Include

type Include struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Paths []*IncludePath `yaml:"paths"`
}

Include is an action that places files into the output directory.

func (*Include) UnmarshalYAML

func (i *Include) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*Include) Validate

func (i *Include) Validate() error

Validate implements Validator.

type IncludePath

type IncludePath struct {
	Pos model.ConfigPos `yaml:"-"`

	As         []model.String `yaml:"as"`
	From       model.String   `yaml:"from"`
	OnConflict model.String   `yaml:"on_conflict"`
	Paths      []model.String `yaml:"paths"`
	Skip       []model.String `yaml:"skip"`
}

IncludePath represents an object for controlling the behavior of included files.

func (*IncludePath) UnmarshalYAML

func (i *IncludePath) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*IncludePath) Validate

func (i *IncludePath) Validate() error

Validate implements Validator.

type Input

type Input struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Name    model.String  `yaml:"name"`
	Desc    model.String  `yaml:"desc"`
	Default *model.String `yaml:"default,omitempty"`
	Rules   []*InputRule  `yaml:"rules"`
}

Input represents one of the parsed "input" fields from the spec.yaml file.

func (*Input) UnmarshalYAML

func (i *Input) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*Input) Validate

func (i *Input) Validate() error

Validate implements Validator.

type InputRule

type InputRule struct {
	Pos model.ConfigPos `yaml:"-"`

	Rule    model.String `yaml:"rule"`
	Message model.String `yaml:"message"` // optional
}

InputRule represents a validation rule attached to an input.

func (*InputRule) UnmarshalYAML

func (i *InputRule) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*InputRule) Validate

func (i *InputRule) Validate() error

Validate implements Validator.

type Print

type Print struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Message model.String `yaml:"message"`
}

Print is an action that prints a message to standard output.

func (*Print) UnmarshalYAML

func (p *Print) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*Print) Validate

func (p *Print) Validate() error

Validate implements Validator.

type RegexNameLookup

type RegexNameLookup struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Paths        []model.String          `yaml:"paths"`
	Replacements []*RegexNameLookupEntry `yaml:"replacements"`
}

RegexNameLookup is an action that replaces named regex capturing groups with the template variable of the same name.

func (*RegexNameLookup) UnmarshalYAML

func (r *RegexNameLookup) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*RegexNameLookup) Validate

func (r *RegexNameLookup) Validate() error

Validate implements Validator.

type RegexNameLookupEntry

type RegexNameLookupEntry struct {
	Pos   model.ConfigPos `yaml:"-"`
	Regex model.String    `yaml:"regex"`
}

RegexNameLookupEntry is one of potentially many regex replacements to be applied.

func (*RegexNameLookupEntry) UnmarshalYAML

func (r *RegexNameLookupEntry) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*RegexNameLookupEntry) Validate

func (r *RegexNameLookupEntry) Validate() error

Validate implements Validator.

type RegexReplace

type RegexReplace struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Paths        []model.String       `yaml:"paths"`
	Replacements []*RegexReplaceEntry `yaml:"replacements"`
}

RegexReplace is an action that replaces a regex match (or a subgroup of it) with a template expression.

func (*RegexReplace) UnmarshalYAML

func (r *RegexReplace) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*RegexReplace) Validate

func (r *RegexReplace) Validate() error

Validate implements Validator.

type RegexReplaceEntry

type RegexReplaceEntry struct {
	Pos               model.ConfigPos `yaml:"-"`
	Regex             model.String    `yaml:"regex"`
	SubgroupToReplace model.String    `yaml:"subgroup_to_replace"`
	With              model.String    `yaml:"with"`
}

RegexReplaceEntry is one of potentially many regex replacements to be applied.

func (*RegexReplaceEntry) UnmarshalYAML

func (r *RegexReplaceEntry) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*RegexReplaceEntry) Validate

func (r *RegexReplaceEntry) Validate() error

Validate implements Validator.

type Spec

type Spec struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Desc   model.String `yaml:"desc"`
	Inputs []*Input     `yaml:"inputs"`
	Steps  []*Step      `yaml:"steps"`
}

Spec represents a parsed spec.yaml file describing a template.

func (*Spec) UnmarshalYAML

func (s *Spec) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*Spec) Upgrade

func (s *Spec) Upgrade(ctx context.Context) (model.ValidatorUpgrader, error)

Upgrade implements model.ValidatorUpgrader.

func (*Spec) Validate

func (s *Spec) Validate() error

Validate implements Validator.

type Step

type Step struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Desc   model.String `yaml:"desc"`
	If     model.String `yaml:"if"`
	Action model.String `yaml:"action"`

	// Each action type has a field below. Only one of these will be set.
	Append          *Append          `yaml:"-"`
	ForEach         *ForEach         `yaml:"-"`
	GoTemplate      *GoTemplate      `yaml:"-"`
	Include         *Include         `yaml:"-"`
	Print           *Print           `yaml:"-"`
	RegexNameLookup *RegexNameLookup `yaml:"-"`
	RegexReplace    *RegexReplace    `yaml:"-"`
	StringReplace   *StringReplace   `yaml:"-"`
}

Step represents one of the work steps involved in rendering a template.

func (*Step) UnmarshalYAML

func (s *Step) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*Step) Validate

func (s *Step) Validate() error

Validate implements Validator.

type StringReplace

type StringReplace struct {
	// Pos is the YAML file location where this object started.
	Pos model.ConfigPos `yaml:"-"`

	Paths        []model.String       `yaml:"paths"`
	Replacements []*StringReplacement `yaml:"replacements"`
}

StringReplace is an action that replaces a string with a template expression.

func (*StringReplace) UnmarshalYAML

func (s *StringReplace) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*StringReplace) Validate

func (s *StringReplace) Validate() error

Validate implements Validator.

type StringReplacement

type StringReplacement struct {
	Pos model.ConfigPos `yaml:"-"`

	ToReplace model.String `yaml:"to_replace"`
	With      model.String `yaml:"with"`
}

func (*StringReplacement) UnmarshalYAML

func (s *StringReplacement) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*StringReplacement) Validate

func (s *StringReplacement) Validate() error

Jump to

Keyboard shortcuts

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