runner

package
v0.0.0-...-8bef8a7 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DockerfilesFolder = filepath.Join(".", "dockerfiles")
	CodeFolder        = filepath.Join(".", "code")
)
View Source
var DefaultRunnerOptions = RunnerOptions{
	DockerfileBasePath: filepath.Join(".", "dockerfile_bases", "Dockerfile_base"),
	Stdin:              os.Stdin,
	Stdout:             os.Stdout,
	Stderr:             os.Stderr,
	Interactive:        false,
	Timeout:            0,
}
View Source
var (
	UnrecoverableError = errors.New("Server error")
)

Functions

func FreeAllResources

func FreeAllResources()

func SetCodeFolder

func SetCodeFolder(newCodeFolder string)

func SetDockerfilesFolder

func SetDockerfilesFolder(newDockerfilesFolder string)

Types

type ErrorDetail

type ErrorDetail struct {
	Message string `json:"message"`
}

type ErrorLine

type ErrorLine struct {
	Error       string      `json:"error"`
	ErrorDetail ErrorDetail `json:"errorDetail"`
}

type Runner

type Runner struct {
	ID             string
	Language       languages.Language
	Context        context.Context
	Client         *client.Client
	CodePath       string
	DockerfilePath string
	Code           []byte
	Options        RunnerOptions
}

func NewRunner

func NewRunner(lang languages.Language, opts *RunnerOptions) *Runner

func (*Runner) BuildImage

func (r *Runner) BuildImage() error

func (*Runner) CreateCodeFileFromBytes

func (r *Runner) CreateCodeFileFromBytes(code []byte) error

func (*Runner) CreateDockerfile

func (r *Runner) CreateDockerfile() error

func (*Runner) ExecCode

func (r *Runner) ExecCode(code []byte) error

func (*Runner) FreeResources

func (r *Runner) FreeResources()

func (*Runner) InitializeContainer

func (r *Runner) InitializeContainer() error

type RunnerOptions

type RunnerOptions struct {
	DockerfileBasePath string
	Stdin              io.Reader
	Stdout             io.Writer
	Stderr             io.Writer
	Interactive        bool
	Timeout            time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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