models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 2 Imported by: 2

Documentation

Overview

Package models provides all models used by the ranna API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorModel

type ErrorModel struct {
	Error   string `json:"error"`
	Code    int    `json:"code"`
	Context string `json:"context,omitempty"`
}

ErrorModel is the reponse model returned from the ranna API when something went wrong.

type ExecutionRequest

type ExecutionRequest struct {
	Language         string            `json:"language"`
	Code             string            `json:"code"`
	InlineExpression bool              `json:"inline_expression"`
	Arguments        []string          `json:"arguments"`
	Environment      map[string]string `json:"environment"`
}

ExecutionRequest is the execution request model.

type ExecutionResponse

type ExecutionResponse struct {
	StdOut     string `json:"stdout"`
	StdErr     string `json:"stderr"`
	ExecTimeMS int    `json:"exectimems"`
}

ExecutionResponse is the response model received on execution request.

type InlineSpec added in v0.2.0

type InlineSpec struct {
	ImportRegex         string         `json:"import_regex" yaml:"import_regex"`
	ImportRegexCompiled *regexp.Regexp `json:"-" yaml:"-"`
	Template            string         `json:"template" yaml:"template"`
}

type SandboxInfo

type SandboxInfo struct {
	Type    string `json:"type"`
	Version string `json:"version"`
}

SandboxInfo wraps information about the used sandbox driver.

type Spec

type Spec struct {
	Image      string      `json:"image,omitempty" yaml:"image,omitempty"`
	Entrypoint string      `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"`
	FileName   string      `json:"filename,omitempty" yaml:"filename,omitempty"`
	Cmd        string      `json:"cmd,omitempty" yaml:"cmd,omitempty"`
	Registry   string      `json:"registry,omitempty" yaml:"registry,omitempty"`
	Use        string      `json:"use,omitempty" yaml:"use,omitempty"`
	Language   string      `json:"language,omitempty" yaml:"language,omitempty"`
	Example    string      `json:"example,omitempty" yaml:"example,omitempty"`
	Inline     *InlineSpec `json:"inline,omitempty" yaml:"inline,omitempty"`
}

Spec defines a code environment specification.

func (*Spec) SupportsTemplating added in v0.2.0

func (spec *Spec) SupportsTemplating() bool

SupportsTemplating checks if a spec supports templating for inline expressions

type SpecMap

type SpecMap map[string]*Spec

SpecMap wraps a map[string]*Spec.

func (SpecMap) Get

func (m SpecMap) Get(key string) (s *Spec, ok bool)

Get returns the last spec in the map also following "use" pointers.

type SystemInfo

type SystemInfo struct {
	Version     string       `json:"version"`
	BuildDate   string       `json:"builddate"`
	GoVersion   string       `json:"go_version"`
	SandboxInfo *SandboxInfo `json:"sandbox"`
}

SystemInfo wraps general information about the ranna deployment.

Jump to

Keyboard shortcuts

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