step

package
v0.0.0-...-f066c3e Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clean

type Clean struct {
	// Path is the path to the directory to clean.
	Path string `json:"path,omitempty" hcl:"path"`

	// Exclude contains a list of files and directories to
	// exclude from the clean.
	Exclude []string `json:"exclude,omitempty" hcl:"exclude,optional"`
}

type Command

type Command struct {
	// Command is the command to execute.
	Run string `json:"run,omitempty" hcl:"run"`

	// WorkDir is the working directory for the command. It overwrites the
	// working directory of the sheet.
	WorkDir string `json:"workDir,omitempty" hcl:"workDir,optional"`

	// ExitCodes is a slice of exit codes that are considered successful.
	ExitCodes []int `json:"exitCodes,omitempty" hcl:"exitCodes,optional"`
}

type Copy

type Copy struct {
	// From the path to the file or directory to copy. It can be a URL for remote
	// files.
	From string `json:"from,omitempty" hcl:"from"`

	// To the path to the destination.
	To string `json:"to,omitempty" hcl:"to"`
}

type Rename

type Rename struct {
	// Old is the path to the file or folder to rename.
	Old string `json:"old,omitempty" hcl:"old"`

	// New is the new path to the file or folder.
	New string `json:"new,omitempty" hcl:"new"`
}

type Step

type Step struct {
	// Name is the name of the step. It is used for logging and representative
	// purposes.
	Name string `json:"name,omitempty" hcl:"name,label"`

	// Clean is the data for cleaning a directory. If it is set, the step is a
	// Clean step.
	Clean *Clean `json:"clean,omitempty" hcl:"clean,block"`

	// Command is the data for running a command. If it is set, the step is a
	// Command step.
	Command *Command `json:"command,omitempty" hcl:"command,block"`

	// Copy is the data for copying a file or directory into another location.
	// If it is set, the step is a Copy step.
	Copy *Copy `json:"copy,omitempty" hcl:"copy,block"`

	// Mkdir is the path to the directory to create. If it is set, the step is a
	// Mkdir step.
	Mkdir *string `json:"mkdir,omitempty" hcl:"mkdir,optional"`

	// Remove is th path to the file or directory to remove. If it is set, the
	// step is a Remove step.
	Remove *string `json:"remove,omitempty" hcl:"remove,optional"`

	// Rename is the data for renaming a file or directory. If it is set, the
	// step is a Rename step.
	Rename *Rename `json:"rename,omitempty" hcl:"rename,block"`
}

Step represents a general step in a configuration file. Only one of the embedded fields can be set.

func (Step) Validate

func (s Step) Validate() error

Validate validates s.

Jump to

Keyboard shortcuts

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