spec

package
v0.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFilename = ".run.yml"
)

DefaultFilename ...

Variables

View Source
var (
	ErrTaskNotFound = fmt.Errorf("task not found")
)

Functions

This section is empty.

Types

type Authors

type Authors []string

Authors ...

type Command

type Command string

Command ...

type Commands

type Commands []Command

Commands ...

type DependsOn

type DependsOn []string

DependsOn ...

type Env

type Env map[string]string

Env ...

type Excludes

type Excludes []string

Excludes ...

type Ignores

type Ignores []string

Ignore ...

type Includes

type Includes []string

Includes ...

type Input

type Input struct {
	Name   string `yaml:"name"`
	Type   string `yaml:"type"`
	Prompt string `yaml:"prompt"`
	Regex  string `yaml:"regex"`
}

Input ...

type Inputs

type Inputs []Input

Inputs ...

type Paths

type Paths []string

Paths ...

type Plugin

type Plugin struct {
	Id          string `yaml:"id"`
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Path        string `yaml:"path"`
}

Plugin ...

type Plugins

type Plugins []Plugin

Plugins ...

type RunOpt

type RunOpt func(*RunOpts)

RunOpt ...

func WithExtraEnv

func WithExtraEnv(env Env) RunOpt

WithExtraEnv ...

func WithExtraVars

func WithExtraVars(vars Vars) RunOpt

WithExtraVars ...

func WithStderr

func WithStderr(w io.Writer) RunOpt

WithStderr ...

func WithStdin

func WithStdin(r io.Reader) RunOpt

WithStdin ...

func WithStdout

func WithStdout(w io.Writer) RunOpt

WithStdout ...

func WithWorkingDir

func WithWorkingDir(dir WorkingDir) RunOpt

WithWorkingDir ...

type RunOpts

type RunOpts struct {
	WorkingDir WorkingDir
	Vars       Vars
	Env        Env
	Stdin      io.Reader
	Stdout     io.Writer
	Stderr     io.Writer
}

RunOpts ...

func (*RunOpts) Configure

func (o *RunOpts) Configure(opts ...RunOpt)

Configure ...

type Spec

type Spec struct {
	// Spec ...
	Spec int `validate:"required" yaml:"spec"`
	// Version ...
	Version string `validate:"required" yaml:"version,omitempty"`
	// Description ...
	Description string `yaml:"description,omitempty"`
	// Authors ...
	Authors Authors `validate:"required" yaml:"authors,omitempty"`
	// Homepage ...
	Homepage string `yaml:"homepage,omitempty"`
	// License ...
	License string `yaml:"license,omitempty"`
	// Repository ...
	Repository string `yaml:"repository,omitempty"`
	// Plugins ...
	Plugins Plugins `yaml:"plugins,omitempty"`
	// Tasks ...
	Tasks Tasks `yaml:"tasks"`
	// Vars ...
	Vars Vars `yaml:"vars"`
	// Env ...
	Env Env `yaml:"env"`
}

Spec ...

func Load

func Load(file string) (*Spec, error)

Load ...

func (*Spec) Default

func (s *Spec) Default() []string

Default ...

func (*Spec) Environ

func (s *Spec) Environ() []string

Environ ...

func (*Spec) Fields

func (s *Spec) Fields() tmpl.Fields

Fields ...

func (*Spec) Find

func (s *Spec) Find(names ...string) ([]string, error)

Find ...

func (*Spec) Validate

func (s *Spec) Validate() error

Validate ..

type Step

type Step struct {
	Cmd              string            `yaml:"cmd"`
	ContinueOnError  bool              `yaml:"continue-on-error"`
	Env              Env               `yaml:"env"`
	Id               string            `yaml:"id"`
	If               string            `yaml:"if"`
	TimeoutInSeconds int64             `yaml:"timeout-in-seconds"`
	Uses             string            `yaml:"uses"`
	Vars             Vars              `yaml:"vars"`
	With             map[string]string `yaml:"with"`
	WorkingDir       WorkingDir        `yaml:"working-dir"`
}

Step ...

func (*Step) Run

func (s *Step) Run(ctx context.Context, opts ...RunOpt) error

Run ...

type Steps

type Steps []Step

Steps ...

type Task

type Task struct {
	If        string    `yaml:"if"`
	Default   bool      `yaml:"default"`
	DependsOn DependsOn `yaml:"depends-on"`
	Name      string    `yaml:"name"`
	Disabled  bool      `yaml:"disabled"`
	Env       Env       `yaml:"env"`
	Vars      Vars      `yaml:"vars"`
	Templates Templates `yaml:"template,omitempty"`

	Watch      Watch      `yaml:"watch"`
	WorkingDir WorkingDir `yaml:"working-dir"`
	Steps      Steps      `yaml:"steps"`
}

Task ...

func (*Task) Environ

func (t *Task) Environ() []string

Task ...

func (*Task) Run

func (t *Task) Run(ctx context.Context, opts ...RunOpt) error

Run ...

type Tasks

type Tasks map[string]Task

Tasks ...

type Template

type Template struct {
	File string `yaml:"file"`
	Out  string `yaml:"out"`
	Vars Vars   `yaml:"var"`
}

Template ...

type Templates

type Templates []Template

Templates ...

type Vars

type Vars map[string]string

Vars ...

func (Vars) Merge

func (v Vars) Merge(vars Vars)

Merge ...

type Watch

type Watch struct {
	Paths   Paths   `yaml:"paths,omitempty"`
	Ignores Ignores `yaml:"ignores,omitempty"`
}

Watch ...

type WorkingDir

type WorkingDir string

WorkingDir ...

func (WorkingDir) String

func (w WorkingDir) String() string

String ...

Jump to

Keyboard shortcuts

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