GoBroke/tplCmd/types.go

22 lines
969 B
Go
Raw Permalink Normal View History

2024-12-17 17:39:10 -05:00
package tplCmd
import (
`encoding/xml`
)
// Cmd is a command that is executed without any templating.
type Cmd struct {
XMLName xml.Name `json:"-" toml:"-" xml:"cmd" yaml:"-"`
Program string `json:"bin" toml:"ProgramPath" xml:"bin,attr" yaml:"Program Path" validate:"required,file"`
Args []string `json:"args" toml:"Argument" xml:"args>arg" yaml:"Arguments"`
IsolateEnv bool `json:"isol8_env" toml:"IsolatedEnv" xml:"isol8Env,attr" yaml:"Isolated Environment"`
EnvVars []string `json:"env" toml:"EnvVars" xml:"envs>env" yaml:"Environment Variables"`
OnChanges *bool `json:"on_change,omitempty" toml:"OnChange,omitempty" xml:"onChange,attr,omitempty" yaml:"On Change,omitempty"`
}
// TemplateCmd is a command that supports templating. (It's in its own package to avoid a cyclic dependency.)
type TemplateCmd struct {
*Cmd `yaml:",inline"`
IsTemplate bool `json:"is_tpl" toml:"IsTemplate" xml:"isTpl,attr" yaml:"Is Template"`
}