manifest

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(ctx context.Context, path string, manifest *Manifest) error

func UnmarshalYAML

func UnmarshalYAML(ctx context.Context, data []byte, manifest *Manifest) error

Types

type Cast

type Cast struct {
	// To is the output path of the cast
	To string `yaml:"to" validate:"required"`
	// From is the input source of the cast
	From Source `yaml:"from" validate:"required"`
	// Variables is the variables of the cast
	Variables Variables `yaml:"variables" validate:"dive"`
	// If is the condition of the cast
	If string `yaml:"if,omitempty" validate:"excluded_with=Unless"`
	// Unless is the negated condition of the cast
	Unless string `yaml:"unless,omitempty" validate:"excluded_with=If"`
	// Each is the loop of the cast
	Each string `yaml:"each,omitempty" validate:"required_with_any=As Include Omit"`
	// As is the name of the loop variable
	As string `yaml:"as,omitempty"`
	// Include is the condition of the loop
	Include string `yaml:"include,omitempty" validate:"excluded_with=Omit"`
	// Omit is the negated condition of the loop
	Omit string `yaml:"omit,omitempty" validate:"excluded_with=Include"`
}

Cast is the cast of the manifest.

type Casts

type Casts = map[string]Cast

Casts is the casts of the manifest.

type Manifest

type Manifest struct {
	// Version is the version of the manifest.
	Version string `yaml:"version" validate:"required"`
	// Name is the name of the manifest.
	Name string `yaml:"name" validate:"required"`
	// Root is the output root dir of the manifest.
	Root string `yaml:"root" validate:"required"`
	// Variables is the variables of the manifest.
	Variables Variables `yaml:"variables" validate:"dive"`
	// Casts is the casts of the manifest.
	Casts Casts `yaml:"casts" validate:"dive"`
}

Manifest is the representation of a manifest file.

type Source

type Source = any

Source is the source of the cast.

type Variable

type Variable struct {
	// Name is the name of the variable.
	Name string `yaml:"name" validate:"required"`
	// Value is the value of the variable.
	Value interface{} `yaml:"value" validate:"required_without_all=Template Env"`
	// Template is the template of the variable.
	Template string `yaml:"template" validate:"required_without_all=Value Env"`
	// Name is the name of the environment variable.
	Env string `yaml:"env" validate:"required_without_all=Value Template"`
}

Variable is the variable of the manifest.

type Variables

type Variables = []Variable

Variables is the variables of the manifest.

Jump to

Keyboard shortcuts

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