api

package
v0.0.0-...-b51bb73 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PostgresConnection *pgx.Conn
View Source
var Redis *redis.Client

Functions

func StartAPI

func StartAPI(local bool)

Types

type CheckRequest

type CheckRequest struct {
	SubmissionID string `json:"submission_id"`
}

type CheckResponse

type CheckResponse struct {
	StdOut  string `json:"stdout"`
	StdErr  string `json:"stderr"`
	Correct bool   `json:"correct"`
	Error   string `json:"error"`
}

func NewCheckResponse

func NewCheckResponse(stdout string, stderr string, err string) CheckResponse

type SubmissionRequest

type SubmissionRequest struct {
	Language string `json:"language"`
	Code     string `json:"code"`
}

func CheckJSONSubmissionRequest

func CheckJSONSubmissionRequest(bodyBytes []byte) (SubmissionRequest, error)

type SubmissionResponse

type SubmissionResponse struct {
	Submitted    bool   `json:"submitted"`
	SubmissionID string `json:"submission_id"`
	Error        string `json:"error"`
}

func NewSubmitResponse

func NewSubmitResponse(submitted bool, submission_id string, error string) SubmissionResponse

Jump to

Keyboard shortcuts

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