Documentation ¶
Index ¶
- Variables
- type DefinitionKind
- type Extension
- type Interpreter
- type Language
- type Name
- type Runbook
- type Runtime
- func (runtime *Runtime) ExitCode() int
- func (runtime *Runtime) GetRunbookError() string
- func (runtime *Runtime) Initialize() error
- func (runtime *Runtime) IsRunbookExecutionSuccessful() bool
- func (runtime *Runtime) IsRunbookRunning() bool
- func (runtime *Runtime) IsSupported() bool
- func (runtime *Runtime) StartRunbookAsync(streamHandler func(string))
- func (runtime *Runtime) StopRunbook() error
Constants ¶
This section is empty.
Variables ¶
View Source
var GetLanguage = func(definitionKind DefinitionKind) (Language, error) { var language Language switch definitionKind { case PowerShell: language = Language{extension: powershellExtension, interpreter: getPowerShellInterpreter()} break case Python2: language = Language{extension: pythonExtension, interpreter: getPython2Interpreter()} break case Python3: language = Language{extension: pythonExtension, interpreter: getPython3Interpreter()} break case Bash: language = Language{extension: bashExtension, interpreter: getBashInterpreter()} break default: return Language{}, errorhelper.NewErrorWithStack("unsupported language") } return language, nil }
View Source
var NewRunbook = func(Name string, versionId string, kind DefinitionKind, definition string) (Runbook, error) { language, err := GetLanguage(kind) if err != nil { return Runbook{}, err } runbook := Runbook{ Name: Name, Kind: kind, Definition: definition, FileName: fmt.Sprintf("%v-%v.%v", Name, versionId, language.extension)} return runbook, nil }
Functions ¶
This section is empty.
Types ¶
type DefinitionKind ¶
type DefinitionKind int
const ( PowerShell DefinitionKind = 5 Python2 DefinitionKind = 9 Python3 DefinitionKind = 10 Bash DefinitionKind = 11 )
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
func (*Language) GetExtension ¶
func (*Language) GetInterpreter ¶
func (l *Language) GetInterpreter() Interpreter
type Runbook ¶
type Runbook struct { Name string Kind DefinitionKind Definition string FileName string }
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func (*Runtime) GetRunbookError ¶
func (*Runtime) Initialize ¶
func (*Runtime) IsRunbookExecutionSuccessful ¶
func (*Runtime) IsRunbookRunning ¶
func (*Runtime) IsSupported ¶
func (*Runtime) StartRunbookAsync ¶
func (*Runtime) StopRunbook ¶
Click to show internal directories.
Click to hide internal directories.