handler

package
v0.0.0-...-da21aa5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LanguageNotSupported = newError(4002, "Language not supported")
	PayloadNotValid      = newError(4003, "Payload not valid")
	TooMuchOutPutErr     = newError(4005, "Too much output")
	TimeOutErr           = newError(4006, "Time out")
	RunCodeErr           = newError(5001, "Run code error")
)
View Source
var VersionMap = map[string][]string{
	"bash": {"4.4"},
	"c": {
		"gcc10",
	},
	"cpp": {
		"gcc10",
	},
	"go": {"1.18"},
	"haskell": {
		"ghc-8.6",
	},
	"python": {
		"3.7",
		"2.7",
	},
	"php": {
		"7.4",
	},
	"java": {
		"14",
	},

	"perl":  {"5.28"},
	"perl6": {"latest"},
	"ruby":  {"2.7"},
	"rust":  {"latest"},
}

VersionMap stands for all languages and versions

Functions

func AllRunners

func AllRunners(c *gin.Context)

AllRunners return all supported languages and their versions

func LVIsSupported

func LVIsSupported(lan, version string) bool

LVIsSupported check if the version of a language is supported

func LanIsSupported

func LanIsSupported(language string) bool

LanIsSupported check if the language is supported

func RunCode

func RunCode(c *gin.Context)

RunCode depended on language type and version

func V2Images

func V2Images(language, version string) string

V2Images return image name for one version of language

func VersionsOfOne

func VersionsOfOne(c *gin.Context)

VersionsOfOne return all version of one language

Types

type PayLoad

type PayLoad struct {
	F []*oneFile `json:"files"`
	A *argument  `json:"argument"`
	I string     `json:"stdin"`
	L string     `json:"language"`
}

PayLoad as stdin pass to ric container's stdin

Jump to

Keyboard shortcuts

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