Documentation
¶
Index ¶
- Constants
- func AddPath(path string)
- func ChangeWorkspace(workspace string)
- func ClearPaths()
- func DisplayWorkSpaces()
- func GetBuild() string
- func GetVersion() string
- func InitConfig() error
- func ListWorkSpaces() []string
- func PathWorker(callback func(int, string))
- func RemoveWorkspace(name string)
- func SaveConfiguration(config Configuration, path string)
- func SaveDefaultConfiguration(workSpaceConfigUpdate bool)
- func ShowPaths(current string) int
- func WorkSpaces(callback func(string))
- type Action
- type CommandLine
- type Configuration
- type ExecuteDefinition
- type IncludePaths
- type RequireCheck
- type RunConfig
- type StopReasons
Constants ¶
const ( // DefaultConfigFileName is the main config json file name. DefaultConfigFileName = "config.json" // DefaultPath this is the default path to store gocd configurations DefaultPath = "/.contxt/" // DefaultWorkspace this is the main configuration workspace DefaultWorkspace = "default" // MirrorPath path for local mirror MirrorPath = "mirror/" )
Variables ¶
This section is empty.
Functions ¶
func PathWorker ¶
PathWorker executes a callback function in a path
func SaveConfiguration ¶
func SaveConfiguration(config Configuration, path string)
SaveConfiguration : stores configuration in given path
func SaveDefaultConfiguration ¶
func SaveDefaultConfiguration(workSpaceConfigUpdate bool)
SaveDefaultConfiguration stores the current configuration as default
func WorkSpaces ¶
func WorkSpaces(callback func(string))
WorkSpaces handler to iterate all workspaces
Types ¶
type Action ¶
type Action struct {
Target string `yaml:"target"`
Stopall bool `yaml:"stopall"`
Script []string `yaml:"script"`
}
Action defines a action that can be executed
type CommandLine ¶
type CommandLine struct {
Require RequireCheck
Command string
Params string
Comment string
StopOnError bool
StopOnOutCountLess int
StopOnOutCountMore int
StopOnOutContains string
TraceOutput bool
}
CommandLine defines a line of commands that can be executed
type Configuration ¶
Configuration includes all paths for the current workspace
var Config Configuration
Config is the the current used configuration
type ExecuteDefinition ¶
type ExecuteDefinition struct {
TestScript []CommandLine
InitScript []CommandLine
CleanScript []CommandLine
Script []CommandLine
}
ExecuteDefinition Defines the structure of a .execute file that defines commands they have to executed
type IncludePaths ¶
type IncludePaths struct {
Include struct {
Basedir bool `yaml:"basedir"`
Folders []string `yaml:"folders"`
} `yaml:"include"`
}
IncludePaths are files the defines how variables should be parsed. they indludes folders they have to be parsed first so they contents can be sued to proceeed with test/template. otherwise the yaml file is not readable
type RequireCheck ¶
RequireCheck defines some variables they have to be valid before script runs
type RunConfig ¶
type RunConfig struct {
Config struct {
Sequencially bool `yaml:"sequencially"`
Coloroff bool `yaml:"coloroff"`
Variables map[string]string `yaml:"variables,omitempty"`
Imports []string `yAML:"imports"`
} `yaml:"config"`
Task []struct {
ID string `yaml:"id"`
Variables map[string]string `yaml:"variables,omitempty"`
Stopreasons struct {
Onerror bool `yaml:"onerror"`
OnoutcountLess int `yaml:"onoutcountLess"`
OnoutcountMore int `yaml:"onoutcountMore"`
OnoutContains []string `yaml:"onoutContains"`
} `yaml:"stopreasons"`
Options struct {
Format string `yaml:"format"`
Stickcursor bool `yaml:"stickcursor"`
Colorcode string `yaml:"colorcode"`
Bgcolorcode string `yaml:"bgcolorcode"`
Panelsize int `yaml:"panelsize"`
Displaycmd bool `yaml:"displaycmd"`
Hideout bool `yaml:"hideout"`
Maincmd string `yaml:"maincmd"`
Mainparams []string `yaml:"mainparams"`
} `yaml:"options"`
Script []string `yaml:"script"`
Listener []struct {
Trigger struct {
Onerror bool `yaml:"onerror"`
OnoutcountLess int `yaml:"onoutcountLess"`
OnoutcountMore int `yaml:"onoutcountMore"`
OnoutContains []string `yaml:"onoutContains"`
} `yaml:"trigger"`
Action struct {
Target string `yaml:"target"`
Stopall bool `yaml:"stopall"`
Script []string `yaml:"script"`
} `yaml:"action"`
} `yaml:"listener"`
} `yaml:"task"`
}
RunConfig defines the structure of the local stored execution files