Documentation ¶
Index ¶
- type BaseEnvironment
- func (e *BaseEnvironment) AddListener(ws *websocket.Conn)
- func (e *BaseEnvironment) CreateWrapper() io.Writer
- func (e *BaseEnvironment) Delete() (err error)
- func (e *BaseEnvironment) DisplayToConsole(daemon bool, msg string, data ...interface{})
- func (e *BaseEnvironment) Execute(cmd string, args []string, env map[string]string, callback func(graceful bool)) (stdOut []byte, err error)
- func (e *BaseEnvironment) ExecuteAsync(cmd string, args []string, env map[string]string, callback func(graceful bool)) (err error)
- func (e *BaseEnvironment) GetBase() *BaseEnvironment
- func (e *BaseEnvironment) GetConsole() (console []string, epoch int64)
- func (e *BaseEnvironment) GetConsoleFrom(time int64) (console []string, epoch int64)
- func (e *BaseEnvironment) GetRootDirectory() string
- func (e *BaseEnvironment) Update() error
- func (e *BaseEnvironment) WaitForMainProcess() (err error)
- type Environment
- type EnvironmentFactory
- type ExecutionFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseEnvironment ¶
type BaseEnvironment struct { Environment Type string RootDirectory string `json:"root"` ConsoleBuffer apufferi.Cache `json:"-"` WSManager utils.WebSocketManager `json:"-"` Wait *sync.WaitGroup `json:"-"` ExecutionFunction ExecutionFunction `json:"-"` WaitFunction func() (err error) `json:"-"` }
func (*BaseEnvironment) AddListener ¶
func (e *BaseEnvironment) AddListener(ws *websocket.Conn)
func (*BaseEnvironment) CreateWrapper ¶
func (e *BaseEnvironment) CreateWrapper() io.Writer
func (*BaseEnvironment) Delete ¶
func (e *BaseEnvironment) Delete() (err error)
func (*BaseEnvironment) DisplayToConsole ¶
func (e *BaseEnvironment) DisplayToConsole(daemon bool, msg string, data ...interface{})
func (*BaseEnvironment) ExecuteAsync ¶
func (*BaseEnvironment) GetBase ¶
func (e *BaseEnvironment) GetBase() *BaseEnvironment
func (*BaseEnvironment) GetConsole ¶
func (e *BaseEnvironment) GetConsole() (console []string, epoch int64)
func (*BaseEnvironment) GetConsoleFrom ¶
func (e *BaseEnvironment) GetConsoleFrom(time int64) (console []string, epoch int64)
func (*BaseEnvironment) GetRootDirectory ¶
func (e *BaseEnvironment) GetRootDirectory() string
func (*BaseEnvironment) Update ¶
func (e *BaseEnvironment) Update() error
func (*BaseEnvironment) WaitForMainProcess ¶
func (e *BaseEnvironment) WaitForMainProcess() (err error)
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() (*pufferd.ServerStats, error) DisplayToConsole(prefix bool, msg string, data ...interface{}) SendCode(code int) error GetBase() *BaseEnvironment }
type EnvironmentFactory ¶
type EnvironmentFactory interface { Create(id string) Environment Key() string }
Click to show internal directories.
Click to hide internal directories.