Documentation
¶
Index ¶
- Constants
- func AddPath(path string)
- func ChangeWorkspace(workspace string, oldspace func(string) bool, newspace func(string))
- func ClearPaths()
- func DisplayWorkSpaces()
- func GetBuild() string
- func GetOs() string
- func GetSharedPath(sharedName string) (string, error)
- func GetVersion() string
- func GetWorkSpacesAsList() ([]string, bool)
- func InitConfig() error
- func ListWorkSpaces() []string
- func PathExists(pathSearch string) bool
- func PathMeightPartOfWs(pathSearch string) bool
- func PathWorker(callback func(int, string))
- func RemoveBadCharacters(input string, dictionary []string) string
- func RemovePath(path string) bool
- func RemoveWorkspace(name string)
- func SanitizeFilename(name string, relativePath bool) string
- func SaveConfiguration(config Configuration, path string)
- func SaveDefaultConfiguration(workSpaceConfigUpdate bool)
- func SetLastIndex(index int)
- func ShowPaths(current string) int
- func WorkSpaces(callback func(string))
- type Action
- type Autorun
- type CommandLine
- type Config
- type Configuration
- type ExecuteDefinition
- type GitVersionInfo
- type IncludePaths
- type Listener
- type Options
- type Require
- type RequireCheck
- type RunConfig
- type StopReasons
- type Task
- type Trigger
Constants ¶
const ( // DefaultConfigFileName is the main config json file name. DefaultConfigFileName = "contxt_current_config.json" // DefaultPath this is the default path to store gocd configurations DefaultPath = "/.contxt/" // DefaultWorkspace this is the main configuration workspace DefaultWorkspace = "default_contxt_ws" // MirrorPath path for local mirror MirrorPath = "mirror/" )
Variables ¶
This section is empty.
Functions ¶
func ChangeWorkspace ¶
ChangeWorkspace changing workspace
func GetSharedPath ¶
func GetWorkSpacesAsList ¶
GetWorkSpacesAsList prints out all workspaces
func PathExists ¶
PathExists checks if this path is stored in current Workspace
func PathMeightPartOfWs ¶
PathMeightPartOfWs checks if the path meight be a part of this workspace
func PathWorker ¶
PathWorker executes a callback function in a path
func RemoveBadCharacters ¶
func RemovePath ¶
RemovePath removes a path from current set. returns true is path was found and removed
func SanitizeFilename ¶
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 SetLastIndex ¶
func SetLastIndex(index int)
SetLastIndex stores the last used index to get back to them after switch
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 what should happens Next.
type Autorun ¶
type Autorun struct {
// this target will be executed if to this workspace was changed
Onenter string `yaml:"onenter"`
// this target will be executed if we changing to another workspace
// so we leaving the current workspace
// can be used for cleanup ...as a example
Onleave string `yaml:"onleave"`
}
Autorun defines the targets they have to be executed if a special event is triggered
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 Config ¶
type Config struct {
Sequencially bool `yaml:"sequencially"`
Coloroff bool `yaml:"coloroff"`
Loglevel string `yaml:"loglevel"`
Variables map[string]string `yaml:"variables,omitempty"`
Autorun Autorun `yaml:"autorun"`
Imports []string `yaml:"imports"`
Use []string `yaml:"use"`
}
Config is the main Configuration part of the Template.
type Configuration ¶
Configuration includes all paths for the current workspace
var UsedConfig Configuration
UsedConfig 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 GitVersionInfo ¶
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 Options ¶
type Options struct {
IgnoreCmdError bool `yaml:"ignoreCmdError"`
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"`
Invisible bool `yaml:"invisible"`
Maincmd string `yaml:"maincmd"`
Mainparams []string `yaml:"mainparams"`
NoAutoRunNeeds bool `yaml:"noAutoRunNeeds"`
TimeoutNeeds int `yaml:"timeoutNeeds"`
TickTimeNeeds int `yaml:"tickTimeNeeds"`
}
Options are the per-task options
type Require ¶
type Require struct {
Exists []string `yaml:"exists"`
NotExists []string `yaml:"notExists"`
Environment map[string]string `yaml:"environment,omitempty"`
Variables map[string]string `yaml:"variables,omitempty"`
System string `yaml:"system,omitempty"`
}
Require defines what is required to execute the task
type RequireCheck ¶
RequireCheck defines some variables they have to be valid before script runs
type StopReasons ¶
type StopReasons struct {
Onerror bool
OnoutcountLess int
OnoutcountMore int
OnoutContains []string
}
StopReasons mapping for RunConfig.Task[].Stopreasons
type Task ¶
type Task struct {
ID string `yaml:"id"`
Variables map[string]string `yaml:"variables,omitempty"`
Requires Require `yaml:"require"`
Stopreasons Trigger `yaml:"stopreasons"`
Options Options `yaml:"options"`
Script []string `yaml:"script"`
Listener []Listener `yaml:"listener"`
Next []string `yaml:"next"`
RunTargets []string `yaml:"runTargets"`
Needs []string `yaml:"needs"`
}
Task is the main Script
type Trigger ¶
type Trigger struct {
Onerror bool `yaml:"onerror"`
OnoutcountLess int `yaml:"onoutcountLess"`
OnoutcountMore int `yaml:"onoutcountMore"`
OnoutContains []string `yaml:"onoutContains"`
Now bool `yaml:"now"`
}
Trigger are part of listener. The defines some events they are triggered by executing scripts most of them watching the output