dao

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ACCEPTABLE_FILE_NAMES = []string{"sake.yaml", "sake.yml", ".sake.yaml", ".sake.yml"}

	DEFAULT_SHELL = "bash -c"

	DEFAULT_TIMEOUT = uint(20)

	DEFAULT_THEME = Theme{
		Name:  "default",
		Table: DefaultTable,
		Text:  DefaultText,
	}

	DEFAULT_TARGET = Target{
		Name:    "default",
		All:     false,
		Servers: []string{},
		Tags:    []string{},
		Regex:   "",
		Invert:  false,
		Limit:   0,
		LimitP:  0,
	}

	DEFAULT_SPEC = Spec{
		Name:              "default",
		Desc:              "the default spec",
		Describe:          false,
		ListHosts:         false,
		Order:             "inventory",
		Silent:            false,
		Hidden:            false,
		Strategy:          "linear",
		Batch:             0,
		BatchP:            0,
		Forks:             10000,
		Output:            "text",
		MaxFailPercentage: 0,
		AnyErrorsFatal:    true,
		IgnoreErrors:      false,
		IgnoreUnreachable: false,
		OmitEmptyRows:     false,
		OmitEmptyColumns:  false,
		Report:            []string{"recap"},
		Verbose:           false,
		Confirm:           false,
		Step:              false,
		Print:             "all",
	}
)
View Source
var DefaultTable = Table{
	Style:  "default",
	Box:    StyleBoxASCII,
	Prefix: `{{ .Host }}`,

	Options: &TableOptions{
		DrawBorder:      core.Ptr(false),
		SeparateColumns: core.Ptr(true),
		SeparateHeader:  core.Ptr(true),
		SeparateRows:    core.Ptr(false),
		SeparateFooter:  core.Ptr(false),
	},

	Border: &BorderColors{
		Header: &CellColors{
			Fg:   core.Ptr(""),
			Bg:   core.Ptr(""),
			Attr: core.Ptr("faint"),
		},

		Row: &CellColors{
			Fg:   core.Ptr(""),
			Bg:   core.Ptr(""),
			Attr: core.Ptr("faint"),
		},

		RowAlternate: &CellColors{
			Fg:   core.Ptr(""),
			Bg:   core.Ptr(""),
			Attr: core.Ptr("faint"),
		},

		Footer: &CellColors{
			Fg:   core.Ptr(""),
			Bg:   core.Ptr(""),
			Attr: core.Ptr("faint"),
		},
	},

	Title: &CellColors{
		Fg:    core.Ptr(""),
		Bg:    core.Ptr(""),
		Align: core.Ptr(""),
		Attr:  core.Ptr("bold"),
	},

	Header: &CellColors{
		Fg:     core.Ptr(""),
		Bg:     core.Ptr(""),
		Align:  core.Ptr(""),
		Attr:   core.Ptr("bold"),
		Format: core.Ptr("default"),
	},

	Row: &CellColors{
		Fg:     core.Ptr(""),
		Bg:     core.Ptr(""),
		Align:  core.Ptr(""),
		Attr:   core.Ptr("normal"),
		Format: core.Ptr("default"),
	},

	Footer: &CellColors{
		Fg:     core.Ptr(""),
		Bg:     core.Ptr(""),
		Align:  core.Ptr(""),
		Attr:   core.Ptr("normal"),
		Format: core.Ptr("default"),
	},
}
View Source
var DefaultText = Text{
	Prefix:       `{{ .Host }}`,
	PrefixColors: []string{"green", "blue", "red", "yellow", "magenta", "cyan"},
	Header:       `{{ .Style "TASK" "bold" }}{{ if ne .NumTasks 1 }} ({{ .Index }}/{{ .NumTasks }}){{end}}{{ if and .Name .Desc }} [{{.Style .Name "bold"}}: {{ .Desc }}] {{ else if .Name }} [{{ .Name }}] {{ else if .Desc }} [{{ .Desc }}] {{end}}`,
	HeaderFiller: "*",
}
View Source
var REGISTER_REGEX = regexp.MustCompile("^[a-zA-Z_]+[a-zA-Z0-9_]*$")
View Source
var StyleBoxASCII = table.BoxStyle{
	BottomLeft:       "+",
	BottomRight:      "+",
	BottomSeparator:  "+",
	EmptySeparator:   text.RepeatAndTrim(" ", text.RuneCount("+")),
	Left:             "|",
	LeftSeparator:    "+",
	MiddleHorizontal: "-",
	MiddleSeparator:  "+",
	MiddleVertical:   "|",
	PaddingLeft:      " ",
	PaddingRight:     " ",
	PageSeparator:    "\n",
	Right:            "|",
	RightSeparator:   "+",
	TopLeft:          "+",
	TopRight:         "+",
	TopSeparator:     "+",
	UnfinishedRow:    " ~",
}
View Source
var StyleBoxLight = table.BoxStyle{
	BottomLeft:       "└",
	BottomRight:      "┘",
	BottomSeparator:  "┴",
	EmptySeparator:   text.RepeatAndTrim(" ", text.RuneCount("┼")),
	Left:             "│",
	LeftSeparator:    "├",
	MiddleHorizontal: "─",
	MiddleSeparator:  "┼",
	MiddleVertical:   "│",
	PaddingLeft:      " ",
	PaddingRight:     " ",
	PageSeparator:    "\n",
	Right:            "│",
	RightSeparator:   "┤",
	TopLeft:          "┌",
	TopRight:         "┐",
	TopSeparator:     "┬",
	UnfinishedRow:    " ≈",
}

Functions

func CheckIsMappingNode

func CheckIsMappingNode(node yaml.Node) error

func CheckIsScalarNode

func CheckIsScalarNode(node yaml.Node) error

func CheckIsSequenceNode

func CheckIsSequenceNode(node yaml.Node) error

func CheckUserNoColor

func CheckUserNoColor(noColorFlag bool)

func EvaluateEnv

func EvaluateEnv(envList []string) ([]string, error)

func EvaluatePassword

func EvaluatePassword(password string) (string, error)

func FormatErrors

func FormatErrors(re Resource, errs []error) error

FormatErrors concats one or many errors attached to it for a single resource.

func IsNullNode

func IsNullNode(node yaml.Node) bool

func MergeEnvs

func MergeEnvs(envs ...[]string) []string

MergeEnvs merges environment variables. Priority is from highest to lowest (1st env takes precedence over the last entry).

func ParseNodeEnv

func ParseNodeEnv(node yaml.Node) []string

func ParseTaskEnv

func ParseTaskEnv(cmdEnv []string, userEnv []string, parentEnv []string, configEnv []string) ([]string, error)

func SelectFirstNonEmpty

func SelectFirstNonEmpty(values ...string) string

SelectFirstNonEmpty selects first non-empty string.

func ServerInSlice

func ServerInSlice(name string, list []Server) bool

func SortServers added in v0.13.0

func SortServers(order string, servers *[]Server)

Types

type Bastion added in v0.15.0

type Bastion struct {
	Host string
	User string
	Port uint16
}

func (Bastion) GetPrint added in v0.15.0

func (b Bastion) GetPrint() string

type BorderColors

type BorderColors struct {
	Header       *CellColors `yaml:"header"`
	Row          *CellColors `yaml:"row"`
	RowAlternate *CellColors `yaml:"row_alt"`
	Footer       *CellColors `yaml:"footer"`
}

type CellColors

type CellColors struct {
	Fg     *string `yaml:"fg"`
	Bg     *string `yaml:"bg"`
	Align  *string `yaml:"align"`
	Attr   *string `yaml:"attr"`
	Format *string `yaml:"format"`
}

type Config

type Config struct {
	SSHConfigFile     *string
	DefaultTimeout    uint
	DisableVerifyHost bool
	KnownHostsFile    string
	Shell             string
	Envs              []string
	Themes            []Theme
	Specs             []Spec
	Targets           []Target
	Servers           []Server
	Tasks             []Task
	Path              string
}

func ReadConfig

func ReadConfig(configFilepath string, userConfigPath string, sshConfigFile string, noColor bool) (Config, error)

Function to read sake configs.

func (*Config) CheckConfigNoColor

func (c *Config) CheckConfigNoColor()

func (*Config) EditConfig

func (c *Config) EditConfig() error

Open sake config in editor

func (*Config) EditServer

func (c *Config) EditServer(name string) error

Open sake config in editor and optionally go to line matching the server name

func (*Config) EditSpec added in v0.12.0

func (c *Config) EditSpec(name string) error

Open sake config in editor and optionally go to line matching the spec name

func (*Config) EditTarget added in v0.12.0

func (c *Config) EditTarget(name string) error

Open sake config in editor and optionally go to line matching the target name

func (*Config) EditTask

func (c *Config) EditTask(name string) error

Open sake config in editor and optionally go to line matching the task name

func (*Config) FilterServers

func (c *Config) FilterServers(
	allServersFlag bool,
	serversFlag []string,
	tagsFlag []string,
	regexFlag string,
	invertFlag bool,
) ([]Server, error)

FilterServers returns servers matching filters, it does a union select.

func (*Config) GetRemoteServerNameAndDesc

func (c *Config) GetRemoteServerNameAndDesc() []string

func (*Config) GetServer

func (c *Config) GetServer(name string) (*Server, error)

func (*Config) GetServerByGroup added in v0.12.0

func (c *Config) GetServerByGroup(group string) (*Server, error)

func (*Config) GetServerGroupsAndDesc added in v0.12.0

func (c *Config) GetServerGroupsAndDesc() []string

func (*Config) GetServerNameAndDesc

func (c *Config) GetServerNameAndDesc() []string

func (*Config) GetServerNames

func (c *Config) GetServerNames() []string

func (*Config) GetServersByName

func (c *Config) GetServersByName(groupNames []string) ([]Server, error)

func (*Config) GetServersByRegex added in v0.12.0

func (c *Config) GetServersByRegex(r string) ([]Server, error)

Matches on server host

func (*Config) GetServersByTags

func (c *Config) GetServersByTags(tags []string) ([]Server, error)

Servers must have all tags to match. For instance, if --tags frontend,backend is passed, then a server must have both tags. We only return error if the flags provided do not exist in the sake config.

func (*Config) GetSpec

func (c *Config) GetSpec(name string) (*Spec, error)

func (*Config) GetSpecNames

func (c *Config) GetSpecNames() []string

func (*Config) GetSpecsByName added in v0.12.0

func (c *Config) GetSpecsByName(names []string) ([]Spec, error)

func (*Config) GetTagAssocations

func (c *Config) GetTagAssocations(tags []string) ([]Tag, error)

func (*Config) GetTags

func (c *Config) GetTags() []string

func (*Config) GetTarget

func (c *Config) GetTarget(name string) (*Target, error)

func (*Config) GetTargetNames

func (c *Config) GetTargetNames() []string

func (*Config) GetTargetsByName added in v0.12.0

func (c *Config) GetTargetsByName(names []string) ([]Target, error)

func (*Config) GetTask

func (c *Config) GetTask(id string) (*Task, error)

func (*Config) GetTaskIDAndDesc

func (c *Config) GetTaskIDAndDesc() []string

func (*Config) GetTaskNames

func (c *Config) GetTaskNames() []string

func (*Config) GetTaskServers

func (c *Config) GetTaskServers(task *Task, runFlags *core.RunFlags, setRunFlags *core.SetRunFlags) ([]Server, error)

func (*Config) GetTasksByIDs

func (c *Config) GetTasksByIDs(ids []string) ([]Task, error)

func (*Config) GetTheme

func (c *Config) GetTheme(name string) (*Theme, error)

func (*Config) GetThemeNames

func (c *Config) GetThemeNames() []string

func (*Config) ParseInventory added in v0.12.0

func (c *Config) ParseInventory(userArgs []string) error

type ConfigResources

type ConfigResources struct {
	DisableVerifyHost *bool
	DefaultTimeout    *uint
	KnownHostsFile    *string
	Shell             string
	Imports           []Import
	Themes            []Theme
	Specs             []Spec
	Targets           []Target
	Tasks             []Task
	Servers           []Server
	Envs              []string

	ConfigErrors []ResourceErrors[ConfigYAML]
	ImportErrors []ResourceErrors[Import]
	ThemeErrors  []ResourceErrors[Theme]
	SpecErrors   []ResourceErrors[Spec]
	TargetErrors []ResourceErrors[Target]
	TaskErrors   []ResourceErrors[Task]
	ServerErrors []ResourceErrors[Server]
}

Used for config imports

func (*ConfigResources) GetSpec

func (c *ConfigResources) GetSpec(name string) (*Spec, error)

func (*ConfigResources) GetTarget

func (c *ConfigResources) GetTarget(name string) (*Target, error)

func (*ConfigResources) GetTask

func (c *ConfigResources) GetTask(id string) (*Task, error)

func (*ConfigResources) GetTheme

func (c *ConfigResources) GetTheme(name string) (*Theme, error)

type ConfigYAML

type ConfigYAML struct {
	// Internal
	Path           string  `yaml:"-"`
	Dir            string  `yaml:"-"`
	UserConfigFile *string `yaml:"-"`

	// Intermediate
	DisableVerifyHost *bool     `yaml:"disable_verify_host"`
	DefaultTimeout    *uint     `yaml:"default_timeout"`
	KnownHostsFile    *string   `yaml:"known_hosts_file"`
	Shell             string    `yaml:"shell"`
	Import            yaml.Node `yaml:"import"`
	Env               yaml.Node `yaml:"env"`
	Themes            yaml.Node `yaml:"themes"`
	Specs             yaml.Node `yaml:"specs"`
	Targets           yaml.Node `yaml:"targets"`
	Servers           yaml.Node `yaml:"servers"`
	Tasks             yaml.Node `yaml:"tasks"`
	// contains filtered or unexported fields
}

func (*ConfigYAML) DecodeSpec added in v0.13.0

func (c *ConfigYAML) DecodeSpec(name string, specYAML yaml.Node) (*Spec, []error)

func (*ConfigYAML) DecodeTarget added in v0.13.0

func (c *ConfigYAML) DecodeTarget(name string, targetYAML yaml.Node) (*Target, []error)

func (*ConfigYAML) GetContext

func (c *ConfigYAML) GetContext() string

func (*ConfigYAML) GetContextLine

func (c *ConfigYAML) GetContextLine() int

func (*ConfigYAML) ParseImportsYAML

func (c *ConfigYAML) ParseImportsYAML() ([]Import, []ResourceErrors[Import])

func (*ConfigYAML) ParseServersYAML

func (c *ConfigYAML) ParseServersYAML() ([]Server, []ResourceErrors[Server])

ParseServersYAML parses the servers dictionary and returns it as a list.

func (*ConfigYAML) ParseSpecsYAML

func (c *ConfigYAML) ParseSpecsYAML() ([]Spec, []ResourceErrors[Spec])

ParseSpecsYAML parses the specs dictionary and returns it as a list.

func (*ConfigYAML) ParseTargetsYAML

func (c *ConfigYAML) ParseTargetsYAML() ([]Target, []ResourceErrors[Target])

ParseTargetsYAML parses the target dictionary and returns it as a list.

func (*ConfigYAML) ParseTasksYAML

func (c *ConfigYAML) ParseTasksYAML() ([]Task, []ResourceErrors[Task])

ParseTasksYAML parses the task dictionary and returns it as a list. This function also sets task references. Valid formats (only one is allowed):

cmd: |
  echo pong

task: ping

tasks:
  - task: ping
  - task: ping
  - cmd: echo pong

func (*ConfigYAML) ParseThemesYAML

func (c *ConfigYAML) ParseThemesYAML() ([]Theme, []ResourceErrors[Theme])

Populates ThemeList

type FoundCyclicDependency

type FoundCyclicDependency struct {
	Cycles []NodeLink
}

func (*FoundCyclicDependency) Error

func (c *FoundCyclicDependency) Error() string

type FoundCyclicTaskDependency

type FoundCyclicTaskDependency struct {
	Cycles []TaskLink
}

func (*FoundCyclicTaskDependency) Error

func (c *FoundCyclicTaskDependency) Error() string

type FoundDuplicateImports

type FoundDuplicateImports struct {
	// contains filtered or unexported fields
}

func (*FoundDuplicateImports) Error

func (c *FoundDuplicateImports) Error() string

type FoundDuplicateObjects added in v0.14.0

type FoundDuplicateObjects struct {
	Name   string
	Type   string
	Values []string
}

func (*FoundDuplicateObjects) Error added in v0.14.0

func (c *FoundDuplicateObjects) Error() string

type Import

type Import struct {
	Path string
	// contains filtered or unexported fields
}

func (*Import) GetContext

func (i *Import) GetContext() string

func (*Import) GetContextLine

func (i *Import) GetContextLine() int

type Items added in v0.12.0

type Items interface {
	GetValue(string, int) string
}

type Node

type Node struct {
	Path     string
	Imports  []Import
	Visiting bool
	Visited  bool
}
type NodeLink struct {
	A Node
	B Node
}

type Report added in v0.13.0

type Report struct {
	ReturnCode int
	Duration   time.Duration
	Status     TaskStatus
}

type ReportData added in v0.13.0

type ReportData struct {
	Headers []string
	Tasks   []ReportRow
	Status  map[TaskStatus]int
}

type ReportRow added in v0.13.0

type ReportRow struct {
	Name   string
	Status map[TaskStatus]int
	Rows   []Report
}

type Resource

type Resource interface {
	GetContext() string
	GetContextLine() int
}

type ResourceErrors

type ResourceErrors[T any] struct {
	Resource *T
	Errors   []error
}

type Row

type Row struct {
	Columns []string
}

func GetTableData added in v0.12.0

func GetTableData[T Items](items []T, headers []string) []Row

func (Row) GetValue

func (r Row) GetValue(_ string, i int) string

type Server

type Server struct {
	Name         string
	Desc         string
	Host         string
	Inventory    string
	Bastions     []Bastion
	User         string
	Port         uint16
	Local        bool
	Tags         []string
	Envs         []string
	Shell        string
	WorkDir      string
	IdentityFile *string
	Password     *string

	// Internal
	Group   string
	PubFile *string

	RootDir string // config dir
	// contains filtered or unexported fields
}

func CreateInventoryServers added in v0.12.0

func CreateInventoryServers(inputHost string, i int, server Server, userArgs []string) (Server, error)

func GetFirstRemoteServer

func GetFirstRemoteServer(servers []Server) (Server, error)

func GetIntersectionServers added in v0.12.0

func GetIntersectionServers(s ...[]Server) []Server

func GetInvertedServers added in v0.12.0

func GetInvertedServers(allServers []Server, excludeServers []Server) []Server

func InitSake

func InitSake(args []string) ([]Server, error)

func (*Server) GetContext

func (s *Server) GetContext() string

func (*Server) GetContextLine

func (s *Server) GetContextLine() int

func (*Server) GetNonDefaultEnvs added in v0.12.0

func (s *Server) GetNonDefaultEnvs() []string

func (Server) GetValue

func (s Server) GetValue(key string, _ int) string

type ServerYAML

type ServerYAML struct {
	Name         string    `yaml:"-"`
	Desc         string    `yaml:"desc"`
	Host         string    `yaml:"host"`
	Hosts        yaml.Node `yaml:"hosts"`
	Inventory    string    `yaml:"inventory"`
	Bastion      string    `yaml:"bastion"`
	Bastions     []string  `yaml:"bastions"`
	User         string    `yaml:"user"`
	Port         uint16    `yaml:"port"`
	Local        bool      `yaml:"local"`
	Tags         []string  `yaml:"tags"`
	Env          yaml.Node `yaml:"env"`
	Shell        string    `yaml:"shell"`
	WorkDir      string    `yaml:"work_dir"`
	IdentityFile *string   `yaml:"identity_file"`
	Password     *string   `yaml:"password"`
}

type Spec

type Spec struct {
	Name              string   `yaml:"_"`
	Desc              string   `yaml:"desc"`
	Describe          bool     `yaml:"describe"`
	ListHosts         bool     `yaml:"list_hosts"`
	Order             string   `yaml:"order"`
	Silent            bool     `yaml:"silent"`
	Hidden            bool     `yaml:"hidden"`
	Strategy          string   `yaml:"strategy"`
	Batch             uint32   `yaml:"batch"`
	BatchP            uint8    `yaml:"batch_p"`
	Forks             uint32   `yaml:"forks"`
	Output            string   `yaml:"output"`
	MaxFailPercentage uint8    `yaml:"max_fail_percentage"`
	AnyErrorsFatal    bool     `yaml:"any_errors_fatal"`
	IgnoreErrors      bool     `yaml:"ignore_errors"`
	IgnoreUnreachable bool     `yaml:"ignore_unreachable"`
	OmitEmptyRows     bool     `yaml:"omit_empty_rows"`
	OmitEmptyColumns  bool     `yaml:"omit_empty_columns"`
	Report            []string `yaml:"report"`
	Verbose           bool     `yaml:"verbose"`
	Confirm           bool     `yaml:"confirm"`
	Step              bool     `yaml:"step"`
	Print             string   `yaml:"print"`
	// contains filtered or unexported fields
}

func (*Spec) GetContext

func (s *Spec) GetContext() string

func (*Spec) GetContextLine

func (s *Spec) GetContextLine() int

func (Spec) GetValue added in v0.12.0

func (s Spec) GetValue(key string, _ int) string

type Table

type Table struct {
	// Stylable via YAML
	Name    string        `yaml:"name"`
	Style   string        `yaml:"style"`
	Prefix  string        `yaml:"prefix"`
	Options *TableOptions `yaml:"options"`

	Border *BorderColors `yaml:"border"`

	Title  *CellColors `yaml:"title"`
	Header *CellColors `yaml:"header"`
	Row    *CellColors `yaml:"row"`
	Footer *CellColors `yaml:"footer"`

	// Not stylable via YAML
	Box table.BoxStyle `yaml:"-"`
}

type TableOptions

type TableOptions struct {
	DrawBorder      *bool `yaml:"draw_border"`
	SeparateColumns *bool `yaml:"separate_columns"`
	SeparateHeader  *bool `yaml:"separate_header"`
	SeparateRows    *bool `yaml:"separate_rows"`
	SeparateFooter  *bool `yaml:"separate_footer"`
}

type TableOutput

type TableOutput struct {
	Headers []string
	Rows    []Row
	Footers []string
}

type Tag

type Tag struct {
	Name    string
	Servers []string
}

func (Tag) GetValue

func (t Tag) GetValue(key string, _ int) string

type Target

type Target struct {
	Name    string   `yaml:"name"`
	Desc    string   `yaml:"desc"`
	All     bool     `yaml:"all"`
	Servers []string `yaml:"servers"`
	Tags    []string `yaml:"tags"`
	Regex   string   `yaml:"regex"`
	Invert  bool     `yaml:"invert"`
	Limit   uint32   `yaml:"limit"`
	LimitP  uint8    `yaml:"limit_p"`
	// contains filtered or unexported fields
}

func (*Target) GetContext

func (t *Target) GetContext() string

func (*Target) GetContextLine

func (t *Target) GetContextLine() int

func (Target) GetValue added in v0.12.0

func (t Target) GetValue(key string, _ int) string

type TargetRange added in v0.12.0

type TargetRange struct {
	Group    string
	Start    int
	End      int
	Range    bool
	HasStart bool
	HasEnd   bool
}

type Task

type Task struct {
	ID      string
	Name    string
	Desc    string
	TTY     bool
	Local   bool
	Attach  bool
	WorkDir string
	Shell   string
	Envs    []string
	Cmd     string
	Tasks   []TaskCmd
	Spec    Spec
	Target  Target
	Theme   Theme

	TaskRefs  []TaskRef
	SpecRef   string
	TargetRef string
	ThemeRef  string
	// contains filtered or unexported fields
}

func (*Task) GetContext

func (t *Task) GetContext() string

func (*Task) GetContextLine

func (t *Task) GetContextLine() int

func (Task) GetValue

func (t Task) GetValue(key string, _ int) string

type TaskCmd

type TaskCmd struct {
	ID           string
	Name         string
	Desc         string
	WorkDir      string
	Shell        string
	RootDir      string
	Register     string
	Cmd          string
	Local        bool
	TTY          bool
	IgnoreErrors bool
	Envs         []string
}

This is the struct that is added to the Task.Tasks in import_task.go

type TaskLink struct {
	A TaskNode
	B TaskNode
}

type TaskNode

type TaskNode struct {
	ID       string
	TaskRefs []TaskRef
	Visiting bool
}

type TaskRef

type TaskRef struct {
	Name         string
	Desc         string
	Cmd          string
	WorkDir      string
	Shell        string
	Register     string
	Task         string
	Local        *bool
	TTY          *bool
	IgnoreErrors *bool
	Envs         []string
}

This is the struct that is added to the Task.TaskRefs

type TaskRefYAML

type TaskRefYAML struct {
	Name         string    `yaml:"name"`
	Desc         string    `yaml:"desc"`
	WorkDir      string    `yaml:"work_dir"`
	Shell        string    `yaml:"shell"`
	Cmd          string    `yaml:"cmd"`
	Task         string    `yaml:"task"`
	Register     string    `yaml:"register"`
	Local        *bool     `yaml:"local"`
	IgnoreErrors *bool     `yaml:"ignore_errors"`
	TTY          *bool     `yaml:"tty"`
	Env          yaml.Node `yaml:"env"`
}

Unmarshaled from YAML

type TaskResources

type TaskResources struct {
	Tasks      []Task
	TaskErrors []ResourceErrors[Task]
}

Used for config imports

type TaskStatus added in v0.13.0

type TaskStatus int64
const (
	Skipped TaskStatus = iota
	Ok
	Failed
	Ignored
	Unreachable
)

func (TaskStatus) String added in v0.13.0

func (s TaskStatus) String() string

type TaskYAML

type TaskYAML struct {
	Name    string        `yaml:"name"`
	Desc    string        `yaml:"desc"`
	Local   bool          `yaml:"local"`
	TTY     bool          `yaml:"tty"`
	Attach  bool          `yaml:"attach"`
	WorkDir string        `yaml:"work_dir"`
	Shell   string        `yaml:"shell"`
	Cmd     string        `yaml:"cmd"`
	Task    string        `yaml:"task"`
	Tasks   []TaskRefYAML `yaml:"tasks"`
	Env     yaml.Node     `yaml:"env"`
	Spec    yaml.Node     `yaml:"spec"`
	Target  yaml.Node     `yaml:"target"`
	Theme   yaml.Node     `yaml:"theme"`
}

Unmarshaled from YAML

type Text

type Text struct {
	Prefix       string   `yaml:"prefix"`
	PrefixColors []string `yaml:"prefix_colors"`
	Header       string   `yaml:"header"`
	HeaderFiller string   `yaml:"header_filler"`
}

type Theme

type Theme struct {
	Name  string `yaml:"name"`
	Table Table  `yaml:"table"`
	Text  Text   `yaml:"text"`
	// contains filtered or unexported fields
}

func (*Theme) GetContext

func (t *Theme) GetContext() string

func (*Theme) GetContextLine

func (t *Theme) GetContextLine() int

Jump to

Keyboard shortcuts

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