Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/file connector #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions connector/file/connector.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package file

import (
"github.com/cranemont/judge-manager/router"
"github.com/cranemont/judge-manager/service/file"
"github.com/cranemont/judge-manager/service/logger"
)
Comment on lines +3 to +7
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test commnet


type connector struct {
file file.FileManager
router router.Router
logger logger.Logger
}

func NewConnector(f file.FileManager, r router.Router, l logger.Logger) *connector {
return &connector{f, r, l}
}

func (c *connector) Connect() {
// validate file source
}

func (c *connector) Disconnect() {
// relaese resources
}

func (c *connector) Handle() {

}
5 changes: 5 additions & 0 deletions connector/file/data/script.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"mode": "judge",
"policy": "temporal",
"dir": "./data"
}
7 changes: 7 additions & 0 deletions connector/file/data/submission_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"problemId": 1,
"code": "#include<stdio.h>\n\n int main () {\n int a;\n scanf(\"%d\\n\", &a);\n printf(\"%d\\n\", a);\n}\n",
"language": "C",
"timeLimit": 1000,
"memoryLimit": 268435456
Comment on lines +3 to +6
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test comment with mention @nmemn

}
27 changes: 27 additions & 0 deletions connector/file/data/testcase_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"id": 1,
"input": 1,
"output": 1
},
{
"id": 1,
"input": 22,
"output": 22
},
{
"id": 1,
"input": 333,
"output": 333
},
{
"id": 1,
"input": 4444,
"output": 4444
},
{
"id": 1,
"input": 55555,
"output": 55555
}
]