diff --git a/connector/file/connector.go b/connector/file/connector.go new file mode 100644 index 0000000..6e2ad20 --- /dev/null +++ b/connector/file/connector.go @@ -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" +) + +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() { + +} diff --git a/connector/file/data/script.json b/connector/file/data/script.json new file mode 100644 index 0000000..785d828 --- /dev/null +++ b/connector/file/data/script.json @@ -0,0 +1,5 @@ +{ + "mode": "judge", + "policy": "temporal", + "dir": "./data" +} \ No newline at end of file diff --git a/connector/file/data/submission_1.json b/connector/file/data/submission_1.json new file mode 100644 index 0000000..7eeedde --- /dev/null +++ b/connector/file/data/submission_1.json @@ -0,0 +1,7 @@ +{ + "problemId": 1, + "code": "#include\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 +} \ No newline at end of file diff --git a/connector/file/data/testcase_1.json b/connector/file/data/testcase_1.json new file mode 100644 index 0000000..c0d041e --- /dev/null +++ b/connector/file/data/testcase_1.json @@ -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 + } +] \ No newline at end of file