services

package
v0.0.0-...-e71170e Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: GPL-2.0, GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearClutter

func ClearClutter()

ClearClutter deletes all the files present in probe's temp directory.

func Log

func Log(severity, message string)

Log prints the given message according to the severity.

Types

type Result

type Result struct {
	Ok        bool                         `json:"ok"`
	Solutions map[string]map[string]string `json:"solutions"`
}

Result struct contains all the parameters returned by the solutions API.

func GetSolutions

func GetSolutions(challengeNumber string) Result

GetSolutions makes a request to the API server and returns a `Result` struct filled with solutions.

type TestCases

type TestCases struct {
	PythonCases     map[string]string `json:"pythonCases"`
	JavascriptCases map[string]string `json:"javascriptCases"`
}

TestCases has python and javascript test cases, and is a part of the `Tester` struct.

type Tester

type Tester struct {
	TestCases     TestCases
	TestCasesFile string
	Code          string
	Lang          string
}

Tester struct is the main struct which has methods related to testing the code.

func (*Tester) PerformTests

func (tester *Tester) PerformTests() bool

PerformTests is the main tester function. It first gets the test cases, hunts the code for imports, exec and eval functions and tests the code, again returning a boolean variable.

Jump to

Keyboard shortcuts

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