judge_service

package
v0.0.0-...-adbf6dd Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidJudgeStatus = fmt.Errorf("invalid judge status")
View Source
var ErrJudgeNotFound = fmt.Errorf("judge not found")

Functions

func CreateJudge

func CreateJudge(
	ctx context.Context, judge judge_model.Judge,
) (*judge_model.Judge, error)

func CreateJudgeResult

func CreateJudgeResult(
	ctx context.Context,
	judgeResult judge_model.JudgeResult,
) (*judge_model.JudgeResult, error)

func GetJudge

func GetJudge(ctx context.Context, uid uuid.UUID) (*judge_model.Judge, error)

func GetJudgeList

func GetJudgeList(
	ctx context.Context, options judge_model.GetJudgeOptions,
) ([]*judge_model.Judge, int64, error)

func GetJudgeUIDFromStreamID

func GetJudgeUIDFromStreamID(streamID string) (*uuid.UUID, error)

func GetRankList

func GetRankList(
	_ context.Context,
	account *string,
	limit, offset *int,
) ([]judge_model.JudgeRank, int64, error)

func PickJudgeTask

func PickJudgeTask(ctx context.Context, consumer string) (*judge_model.JudgeTask, error)

func ReportJudgeResult

func ReportJudgeResult(
	ctx context.Context,
	result judge_model.JudgeResult,
) (*judge_model.JudgeResult, error)

func ReportJudgeResultCount

func ReportJudgeResultCount(
	ctx context.Context,
	judgeUID uuid.UUID, resultCount uint,
) error

func ReportJudgeTask

func ReportJudgeTask(
	ctx context.Context,
	consumer string, streamID string, verdict judge_model.JudgeVerdict,
) error

func UpsertJudgeCache

func UpsertJudgeCache(ctx context.Context, uid uuid.UUID, verdict judge_model.JudgeVerdict) error

Types

type Time

type Time struct {
	Secs  float64 `json:"secs"`
	Nanos float64 `json:"nanos"`
}

type VerdictJson

type VerdictJson struct {
	Verdict           string  `json:"verdict"`
	TimeUsage         Time    `json:"time_usage"`
	MemoryUsageBytes  float64 `json:"memory_usage_bytes"`
	ExitStatus        int     `json:"exit_status"`
	CheckerExitStatus int     `json:"checker_exit_status"`
}

Jump to

Keyboard shortcuts

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