lib

package
v0.0.0-...-36ae7f7 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(message string, args ...interface{})

func Info

func Info(message string, args ...interface{})

Types

type ApproveAssertion

type ApproveAssertion struct{}

ApproveAssertion asks user whether to proceed to execution

type Assertion

type Assertion interface {
	// contains filtered or unexported methods
}

type GcloudProjectAssertion

type GcloudProjectAssertion struct {
	Expect string
}

GcloudProjectAssertion checks current `gcloud` project by executing `gcloud config get-value project` and compares its output with Expect

type Goal

type Goal struct {
	Name   string
	Cmd    string
	Args   []string
	Assert []Assertion
	Env    string
	Desc   string
}

func (Goal) Cli

func (c Goal) Cli() string

func (Goal) String

func (c Goal) String() string

type Goals

type Goals struct {
	Commands []Goal
}

func ParseCommands

func ParseCommands(bytes []byte) (*Goals, error)

ParseCommands from byte input (YAML)

func (*Goals) Exec

func (c *Goals) Exec(name string, env string)

func (*Goals) GetWithEnv

func (c *Goals) GetWithEnv(name string, env string) (*Goal, bool)

func (*Goals) Render

func (c *Goals) Render()

type KubectlContextAssertion

type KubectlContextAssertion struct {
	Expect string
}

KubectlContextAssertion checks current `kubectl` context by executing `kubectl config current-context` and compares its output with Expect

type RefAssertion

type RefAssertion struct {
	Desc   string
	Ref    string
	Expect string
	Fix    string
}

RefAssertion calls another goal and compares its trimmed output with Expect

type TerraformWorkspaceAssertion

type TerraformWorkspaceAssertion struct {
	Expect string
}

TerraformWorkspaceAssertion checks current Terraform workspace by executing `terraform workspace show` and compares its output with Expect

type YamlAssert

type YamlAssert struct {
	Desc               string `yaml:"desc,omitempty"`
	Ref                string `yaml:"ref,omitempty"`
	Expect             string `yaml:"expect,omitempty"`
	Fix                string `yaml:"fix,omitempty"`
	Approval           string `yaml:"approval,omitempty"`
	TerraformWorkspace string `yaml:"terraform_workspace,omitempty"`
	KubectlContext     string `yaml:"kubectl_context,omitempty"`
	GcloudProject      string `yaml:"gcloud_project,omitempty"`
}

func (YamlAssert) String

func (a YamlAssert) String() string

type YamlEnvGoal

type YamlEnvGoal struct {
	Cmd    string       `yaml:"cmd"`
	Args   []string     `yaml:"args,omitempty"`
	Assert []YamlAssert `yaml:"assert,omitempty"`
	Desc   string       `yaml:"desc"`
}

type YamlGoal

type YamlGoal struct {
	Envs   *map[string]YamlEnvGoal `yaml:"envs,omitempty"`
	Cmd    string                  `yaml:"cmd,omitempty"`
	Args   []string                `yaml:"args,omitempty"`
	Assert []YamlAssert            `yaml:"assert,omitempty"`
	Desc   string                  `yaml:"desc,omitempty"`
}

Jump to

Keyboard shortcuts

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