config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound error = errors.New("configuration file isn't found")

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Prog        expr.BoolProgram
	Initialized bool
	Fixed       bool
	FixedValue  bool
}

func (Bool) Match

func (b Bool) Match(params map[string]interface{}) (bool, error)

func (*Bool) SetBool

func (b *Bool) SetBool(f bool)

func (*Bool) SetBoolProgram added in v0.7.0

func (b *Bool) SetBoolProgram(f expr.BoolProgram)

func (*Bool) SetDefaultBool

func (b *Bool) SetDefaultBool(f bool)

func (*Bool) UnmarshalYAML

func (b *Bool) UnmarshalYAML(unmarshal func(interface{}) error) error

type BuildCondition

type BuildCondition struct {
	Skip Bool
	Fail Bool
}

type Command

type Command struct {
	Shell       string
	ShellOpts   []string `yaml:"shell_options"`
	Command     Template
	CommandFile string `yaml:"command_file"`
	Stdin       Template
	StdinFile   string `yaml:"stdin_file"`
	Env         Envs
}

func (Command) SetDefault

func (cmd Command) SetDefault() Command

type Config

type Config struct {
	Phases      []Phase
	Owner       string
	Repo        string
	Condition   BuildCondition
	LogLevel    string `yaml:"log_level"`
	GitHubToken string `yaml:"github_token"`
	Env         Env    `yaml:"-"`
	Parallelism int
	PR          bool
	Meta        map[string]interface{}
}

func Set

func Set(cfg Config) (Config, error)

type Dependency

type Dependency struct {
	Names   []string
	Program expr.BoolProgram
}

func (*Dependency) UnmarshalYAML added in v0.4.0

func (dependency *Dependency) UnmarshalYAML(unmarshal func(interface{}) error) error

type Env

type Env struct {
	Owner        string
	Repo         string
	PRNumber     int
	Branch       string
	SHA          string
	Tag          string
	Ref          string
	PRBaseBranch string
	IsPR         bool
	CI           bool
}

type EnvVar

type EnvVar struct {
	Key       template.Template
	Value     template.Template
	ValueFile string `yaml:"value_file"`
}

type Envs

type Envs struct {
	Vars     []EnvVar
	Compiled []string
}

func (*Envs) UnmarshalYAML

func (envs *Envs) UnmarshalYAML(unmarshal func(interface{}) error) error

type ExistFile

type ExistFile func(string) bool

type HTTP

type HTTP struct {
	URL string
}

type Item

type Item struct {
	Key   interface{}
	Value interface{}
}

type Items

type Items struct {
	Items   interface{}
	Program expr.Program
}

func (Items) Run added in v0.2.0

func (items Items) Run(params map[string]interface{}) (interface{}, error)

func (*Items) UnmarshalYAML added in v0.8.1

func (items *Items) UnmarshalYAML(unmarshal func(interface{}) error) error

type Phase

type Phase struct {
	Name      string
	Tasks     []Task
	Condition PhaseCondition
	Meta      map[string]interface{}
	Import    string
}

type PhaseCondition

type PhaseCondition struct {
	Skip Bool
	Exit Bool
	Fail Bool
}

type ReadFile

type ReadFile struct {
	Path   Template
	Format string
}

type Reader

type Reader struct {
	ExistFile ExistFile
}

func (Reader) FindAndRead

func (reader Reader) FindAndRead(cfgPath, wd string) (Config, string, error)

type Script added in v0.3.0

type Script struct {
	Prog expr.Program
}

func (Script) Run added in v0.3.0

func (script Script) Run(params map[string]interface{}) (interface{}, error)

func (*Script) UnmarshalYAML added in v0.3.0

func (script *Script) UnmarshalYAML(unmarshal func(interface{}) error) error

type Task

type Task struct {
	Name       Template
	Type       string `yaml:"-"`
	When       Bool
	WhenFile   string `yaml:"when_file"`
	Dependency Dependency
	Command    Command
	ReadFile   ReadFile  `yaml:"read_file"`
	WriteFile  WriteFile `yaml:"write_file"`
	HTTP       HTTP
	Timeout    execute.Timeout
	Items      Items
	Item       Item `yaml:"-"`
	Meta       map[string]interface{}
	Output     Script
	Input      Script
	InputFile  string `yaml:"input_file"`
	OutputFile string `yaml:"output_file"`
	Import     string
}

func (*Task) Set

func (task *Task) Set() error

func (*Task) SetType

func (task *Task) SetType() error

type Template

type Template struct {
	Text     string
	Template template.Template
}

func (Template) New

func (tmpl Template) New(params interface{}) (Template, error)

func (*Template) SetText added in v0.5.0

func (tmpl *Template) SetText(text string) error

func (*Template) UnmarshalYAML

func (tmpl *Template) UnmarshalYAML(unmarshal func(interface{}) error) error

type WriteFile added in v0.4.0

type WriteFile struct {
	Path         Template
	Template     Template
	TemplateFile string `yaml:"template_file"`
}

Jump to

Keyboard shortcuts

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