go-judge-client

module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT

README

go-judge-client

Under designing & development

GoDoc Go Report Card Release

The goal to to reimplement syzoj/judge-v3 in GO language using go-sandbox and go-judge

Workflow

+-----------------------------------------------+     +--------+
| Judger (judger logic)                         | <-> | Client |
+--------------------------+-------------+------+     +--------+
| Language (Compile + Run) | ProgramConf | Data |
+--------------------------+-------------+------+
| Executor Server (RPC)    |
+--------------------------+

Interfaces

  • client: receive judge tasks (websocket / socket.io / RabbitMQ / REST API / gRPC stream)
  • data: interface to download, cache, lock and access test data files from website (by dataId)
  • language: programming language compile & execute configurations for Executor Server
  • problem: parse problem definition from configuration files

Logic

  • judger: execute judge logics (compile / standard / interactive / answer submit) then collect and calculate results

Models

  • JudgeTask: judge task pushed from website (type, source, data)
  • JudgeResult: judge task result send back to website
  • JudgeSetting: problem setting (from yaml) and JudgeCase

Planned API

Client Status

Up <-> Down

Task Progress

Client is able to report progress to the web front-end. Task should maintain its states

Planned events are:

(Preparing) -> Parsed -> (Compiling) -> Compiled -> loop each sub task (Judging) Progressed end Finished

  • Parsed: problem data have been downloaded and problem configuration have been parsed (pass problem config to task)
  • Compiled: user code have been compiled (success / fail)
  • Progressed: single test case finished (success / fail - detail message)
  • Finished: all test cases finished / compile failed

Context are defined by the client to handle cancellation. Subsequent task will be cancelled and the correspond event may not be trigger.

TODO

  • socket.io client with namespace
  • judge_v3 protocol
  • executor server integration
  • refactor
  • syzoj problem YAML config parser
  • syzoj data downloader
  • syzoj compile configuration
  • file io
  • special judger
  • interact problem
  • answer submit
  • demo site
  • uoj support

Directories

Path Synopsis
syzojclient
Package syzojclient provides interface interact with syzoj front-end.
Package syzojclient provides interface interact with syzoj front-end.
cmd
pkg
diff
Package diff provides function to compare contents from reader and returns error information if they are different.
Package diff provides function to compare contents from reader and returns error information if they are different.

Jump to

Keyboard shortcuts

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