api

package
v0.0.0-...-c3f09fc Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const PATH_PREFIX = "scvzcaae"

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireTaskResponse

type AcquireTaskResponse struct {
	TaskID      int    `json:"task_id",db:"task_id"`
	ProgramID   int64  `json:"program_id",db:"program_id"`
	ProgramName string `json:"program_name",db:"program_name"`
	ProgramCode string `json:"program_code",db:"program_code"`
}

func AcquireTask

func AcquireTask() (*AcquireTaskResponse, error)

type EvaluateRequest

type EvaluateRequest struct {
	ProblemID int    `json:"problem_id"`
	ISL       string `json:"isl"`
}

type EvaluateResponse

type EvaluateResponse struct {
	ProblemID  int    `json:"problem_id"`
	Cost       int64  `json:"cost"`
	Similarity int64  `json:"similarity"`
	Image      string `json:"image"`
}

func Evaluate

func Evaluate(req *EvaluateRequest) (*EvaluateResponse, error)

type ExportResponse

type ExportResponse struct {
	RunID      int    `json:"id" db:"run_id"`
	ProblemID  int    `json:"problem_id" db:"problem_id"`
	RunCreated string `json:"submitted_at" db:"run_created"`
	RunScore   *int64 `json:"cost" db:"run_score"`
	ISL        string `json:"-" db:"solution_isl"`
}

func ExportRun

func ExportRun(runID int) (*ExportResponse, error)

type InsertProgramRequest

type InsertProgramRequest struct {
	ProgramName     string `json:"program_id"`
	ProgramCode     string `json:"program_code"`
	ProgramPipeline int    `json:"program_pipeline"`
}

type InsertProgramResponse

type InsertProgramResponse struct {
	ProgramID int   `json:"program_id"`
	RunIDs    []int `json:"run_ids"`
}

type InsertTaskRequest

type InsertTaskRequest struct {
	ProblemID int `json:"problem_id"`
	// Set 1 if manual.
	ProgramID int `json:"program_id"`
	// For manual usage only.
	TaskSolution string `json:"task_solution"`
	// Required if manual.
	TaskName string `json:"task_name"`
}

type InsertTaskResponse

type InsertTaskResponse struct {
	TaskID int `json:"task_id"`
	// If 0, the solution is broken or the server is busy.
	TaskSolutionScore int64 `json:"task_solution_score"`
}

func InsertTask

func InsertTask(req *InsertTaskRequest) (*InsertTaskResponse, error)

type RunAcquireResponse

type RunAcquireResponse struct {
	RunID        int64  `json:"run_id" db:"run_id"`
	RunCommand   string `json:"run_command" db:"run_command"`
	RunSignature string `json:"run_signature" db:"run_signature"`
}

type RunAddRequest

type RunAddRequest struct {
	ProblemID   int    `json:"problem_id"`
	ProgramID   int    `json:"program_id"`
	SolutionISL string `json:"solution_isl"`
	RunPipeline int    `json:"run_pipeline"`
	RunName     string `json:"run_name"`
	RunCommand  string `json:"run_command"`
}

type RunAddResponse

type RunAddResponse struct {
	RunID    int   `json:"run_id"`
	RunScore int64 `json:"run_score"`
}

func RunAdd

func RunAdd(ctx context.Context, req *RunAddRequest) (*RunAddResponse, error)

type RunEvaluateRequest

type RunEvaluateRequest struct {
	RunID int `json:"run_id"`
}

type RunEvaluateResponse

type RunEvaluateResponse struct {
	RunScore int64 `json:"run_score"`
}

type RunExtendRequest

type RunExtendRequest struct {
	RunSignature string `json:"run_signature" db:"run_signature"`
}

type RunFlushRequest

type RunFlushRequest struct {
	RunSignature string `json:"run_signature" db:"run_signature"`
	RunCode      int64  `json:"run_code" db:"run_code"`
	SolutionISL  string `json:"solution_isl" db:"solution_isl"`
	LogID        string `json:"log_id"`
}

type SubmitRequest

type SubmitRequest struct {
	ProblemID int    `json:"problem_id"`
	Name      string `json:"name"`
	ISL       []byte `json:"isl"`
}

func Submit

func Submit(req *SubmitRequest) (*SubmitRequest, error)

type SubmitResponse

type SubmitResponse struct {
	TaskID int `json:"task_id"`
}

type UpdateTaskRequest

type UpdateTaskRequest struct {
	TaskID       int    `json:"task_id"`
	TaskSolution string `json:"task_solution"`
}

type UpdateTaskResponse

type UpdateTaskResponse struct {
	TaskID            int   `json:"task_id"`
	TaskSolutionScore int64 `json:"task_solution_score"`
}

func UpdateTask

func UpdateTask(req *UpdateTaskRequest) (*UpdateTaskResponse, error)

Jump to

Keyboard shortcuts

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