environments

package
Version: v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2019 License: Apache-2.0 Imports: 31 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSupportedEnvironments added in v1.2.5

func GetSupportedEnvironments() []string

func LoadModules added in v1.2.5

func LoadModules()

Types

type BaseEnvironment added in v1.2.0

type BaseEnvironment struct {
	Environment
	RootDirectory string                 `json:"-"`
	ConsoleBuffer cache.Cache            `json:"-"`
	WSManager     utils.WebSocketManager `json:"-"`

	Type string `json:"type"`
	// contains filtered or unexported fields
}

func (*BaseEnvironment) AddListener added in v1.2.0

func (e *BaseEnvironment) AddListener(ws *websocket.Conn)

func (*BaseEnvironment) Delete added in v1.2.0

func (e *BaseEnvironment) Delete() (err error)

func (*BaseEnvironment) DisplayToConsole added in v1.2.0

func (e *BaseEnvironment) DisplayToConsole(msg string, data ...interface{})

func (*BaseEnvironment) Execute added in v1.2.0

func (e *BaseEnvironment) Execute(cmd string, args []string, env map[string]string, callback func(graceful bool)) (stdOut []byte, err error)

func (*BaseEnvironment) ExecuteAsync added in v1.2.0

func (e *BaseEnvironment) ExecuteAsync(cmd string, args []string, env map[string]string, callback func(graceful bool)) (err error)

func (*BaseEnvironment) GetConsole added in v1.2.0

func (e *BaseEnvironment) GetConsole() (console []string, epoch int64)

func (*BaseEnvironment) GetConsoleFrom added in v1.2.0

func (e *BaseEnvironment) GetConsoleFrom(time int64) (console []string, epoch int64)

func (*BaseEnvironment) GetRootDirectory added in v1.2.0

func (e *BaseEnvironment) GetRootDirectory() string

func (*BaseEnvironment) Update added in v1.2.0

func (e *BaseEnvironment) Update() error

func (*BaseEnvironment) WaitForMainProcess added in v1.2.0

func (e *BaseEnvironment) WaitForMainProcess() (err error)

type DockerFactory added in v1.2.5

type DockerFactory struct {
	EnvironmentFactory
}

func (DockerFactory) Create added in v1.2.5

func (df DockerFactory) Create(folder, id string, environmentSection map[string]interface{}, rootDirectory string, cache cache.Cache, wsManager utils.WebSocketManager) Environment

func (DockerFactory) Key added in v1.2.5

func (df DockerFactory) Key() string

type Environment

type Environment interface {
	//Executes a command within the environment.
	Execute(cmd string, args []string, env map[string]string, callback func(graceful bool)) (stdOut []byte, err error)

	//Executes a command within the environment and immediately return
	ExecuteAsync(cmd string, args []string, env map[string]string, callback func(graceful bool)) (err error)

	//Sends a string to the StdIn of the main program process
	ExecuteInMainProcess(cmd string) (err error)

	//Kills the main process, but leaves the environment running.
	Kill() (err error)

	//Creates the environment setting needed to run programs.
	Create() (err error)

	//Deletes the environment.
	Delete() (err error)

	Update() (err error)

	IsRunning() (isRunning bool, err error)

	WaitForMainProcess() (err error)

	WaitForMainProcessFor(timeout int) (err error)

	GetRootDirectory() string

	GetConsole() (console []string, epoch int64)

	GetConsoleFrom(time int64) (console []string, epoch int64)

	AddListener(ws *websocket.Conn)

	GetStats() (map[string]interface{}, error)

	DisplayToConsole(msg string, data ...interface{})

	SendCode(code int) error
}

func Create added in v1.2.5

func Create(environmentType, folder, id string, environmentSection map[string]interface{}) (Environment, error)

type EnvironmentFactory added in v1.2.5

type EnvironmentFactory interface {
	Create(folder, id string, environmentSection map[string]interface{}, rootDirectory string, cache cache.Cache, wsManager utils.WebSocketManager) Environment

	Key() string
}

type StandardFactory added in v1.2.5

type StandardFactory struct {
	EnvironmentFactory
}

func (StandardFactory) Create added in v1.2.5

func (sf StandardFactory) Create(folder, id string, environmentSection map[string]interface{}, rootDirectory string, cache cache.Cache, wsManager utils.WebSocketManager) Environment

func (StandardFactory) Key added in v1.2.5

func (sf StandardFactory) Key() string

type TtyFactory added in v1.2.5

type TtyFactory struct {
	EnvironmentFactory
}

func (TtyFactory) Create added in v1.2.5

func (tf TtyFactory) Create(folder, id string, environmentSection map[string]interface{}, rootDirectory string, cache cache.Cache, wsManager utils.WebSocketManager) Environment

func (TtyFactory) Key added in v1.2.5

func (tf TtyFactory) Key() string

Jump to

Keyboard shortcuts

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