Documentation ¶
Overview ¶
Libraries related to the worker of moolinet It will compile, analyse and execute the code in a sandbox
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerSandbox ¶
type DockerSandbox struct {
// contains filtered or unexported fields
}
func NewDockerSandbox ¶
func NewDockerSandbox(image string) (*DockerSandbox, error)
We should use a design pattern such as Fabric or Builder, or somethng similar In order to split the creation logic and the command logic. BUG(#2) We should not try to download the image every time we start a new container. We should check if it exists locally.
func (*DockerSandbox) Destroy ¶
func (s *DockerSandbox) Destroy()
func (*DockerSandbox) GetLogs ¶
func (s *DockerSandbox) GetLogs() string
type Sandbox ¶
type Sandbox interface { // Destroy the sandbox on the main system. // Usually just after its creation with defer. Destroy() // Run a command in the sandbox and get its outputs // (output, error) Run(command []string, timeout int, connection bool) (string, error) // Get logs linked to the Sandbox // Useful for debugging GetLogs() string }
The sandbox interface which enable you to run your program indepandtly of the implementation of the sandbox
Notes ¶
Bugs ¶
We should not try to download the image every time we start a new container. We should check if it exists locally.
Logs are not checked for error when pulling an image