runtime

package
v0.0.0-...-12b6483 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

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 Extension

type Extension string

type Interpreter

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

type Language

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

func (*Language) GetExtension

func (l *Language) GetExtension() Extension

func (*Language) GetInterpreter

func (l *Language) GetInterpreter() Interpreter

type Name

type Name string

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 NewRuntime(language Language, runbook Runbook, jobData jrds.JobData, workingDirectory string) Runtime

func (*Runtime) ExitCode

func (runtime *Runtime) ExitCode() int

func (*Runtime) GetRunbookError

func (runtime *Runtime) GetRunbookError() string

func (*Runtime) Initialize

func (runtime *Runtime) Initialize() error

func (*Runtime) IsRunbookExecutionSuccessful

func (runtime *Runtime) IsRunbookExecutionSuccessful() bool

func (*Runtime) IsRunbookRunning

func (runtime *Runtime) IsRunbookRunning() bool

func (*Runtime) IsSupported

func (runtime *Runtime) IsSupported() bool

func (*Runtime) StartRunbookAsync

func (runtime *Runtime) StartRunbookAsync(streamHandler func(string))

func (*Runtime) StopRunbook

func (runtime *Runtime) StopRunbook() error

Jump to

Keyboard shortcuts

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