handler

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(args []string) error

Types

type Arg

type Arg struct {
	Name       string
	Usage      string
	Default    string
	InputEnvs  []string `yaml:"input_envs"`
	ScriptEnvs []string `yaml:"script_envs"`
	Required   bool
	Prompt     Prompt
	Validate   []Validate
}

type Config

type Config struct {
	Tasks       []Task
	InputEnvs   []string `yaml:"input_envs"`
	ScriptEnvs  []string `yaml:"script_envs"`
	Environment map[string]string
	Timeout     Timeout
	Quiet       *bool
}

type Flag

type Flag struct {
	Name       string
	Short      string
	Usage      string
	Default    string
	InputEnvs  []string `yaml:"input_envs"`
	ScriptEnvs []string `yaml:"script_envs"`
	Type       string
	Required   bool
	Prompt     Prompt
	Validate   []Validate
}

type GlobalFlags added in v1.3.0

type GlobalFlags struct {
	DryRun     bool
	Quiet      *bool
	WorkingDir string
}

type Prompt added in v0.9.0

type Prompt struct {
	Type    string
	Message string
	Help    string
	Options []string
}

type Require added in v1.1.0

type Require struct {
	Exec        []StrList
	Environment []StrList
}

type StrList added in v1.1.0

type StrList []string

func (*StrList) UnmarshalYAML added in v1.1.0

func (list *StrList) UnmarshalYAML(unmarshal func(interface{}) error) error

type Task

type Task struct {
	Name        string
	Short       string
	Description string
	Usage       string
	Flags       []Flag
	Args        []Arg
	InputEnvs   []string `yaml:"input_envs"`
	ScriptEnvs  []string `yaml:"script_envs"`
	Environment map[string]string
	Script      string
	Timeout     Timeout
	Require     Require
	Quiet       *bool
}

type Timeout added in v0.7.0

type Timeout struct {
	Duration  int
	KillAfter int `yaml:"kill_after"`
}

type Validate added in v1.3.0

type Validate struct {
	Type      string
	RegExp    string `yaml:"regexp"`
	MinLength int    `yaml:"min_length"`
	MaxLength int    `yaml:"max_length"`
	Prefix    string
	Suffix    string
	Contain   string
	Enum      []string

	Min int
	Max int
}

Jump to

Keyboard shortcuts

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