chore(executor): move struct to meta.go
This commit is contained in:
parent
49b7c7c5db
commit
7254c48f9a
|
@ -5,8 +5,6 @@ import (
|
|||
"github.com/joint-online-judge/JOJ3/internal/stage"
|
||||
)
|
||||
|
||||
type Dummy struct{}
|
||||
|
||||
func (e *Dummy) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
|
||||
var res []stage.ExecutorResult
|
||||
for range cmds {
|
||||
|
|
|
@ -4,6 +4,8 @@ import "github.com/joint-online-judge/JOJ3/internal/stage"
|
|||
|
||||
var name = "dummy"
|
||||
|
||||
type Dummy struct{}
|
||||
|
||||
func init() {
|
||||
stage.RegisterExecutor(name, &Dummy{})
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@ import (
|
|||
"github.com/joint-online-judge/JOJ3/internal/stage"
|
||||
)
|
||||
|
||||
type Local struct{}
|
||||
|
||||
func generateResult(
|
||||
err error,
|
||||
processState *os.ProcessState,
|
||||
|
|
|
@ -4,6 +4,8 @@ import "github.com/joint-online-judge/JOJ3/internal/stage"
|
|||
|
||||
var name = "local"
|
||||
|
||||
type Local struct{}
|
||||
|
||||
func init() {
|
||||
stage.RegisterExecutor(name, &Local{})
|
||||
}
|
||||
|
|
|
@ -10,12 +10,6 @@ import (
|
|||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Sandbox struct {
|
||||
execServer, token string
|
||||
cachedMap map[string]string
|
||||
execClient pb.ExecutorClient
|
||||
}
|
||||
|
||||
func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
|
||||
var err error
|
||||
if e.execClient == nil {
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
package sandbox
|
||||
|
||||
import (
|
||||
"github.com/criyle/go-judge/pb"
|
||||
"github.com/joint-online-judge/JOJ3/internal/stage"
|
||||
)
|
||||
|
||||
var name = "sandbox"
|
||||
|
||||
type Sandbox struct {
|
||||
execServer, token string
|
||||
cachedMap map[string]string
|
||||
execClient pb.ExecutorClient
|
||||
}
|
||||
|
||||
func init() {
|
||||
stage.RegisterExecutor(name, &Sandbox{
|
||||
execServer: "localhost:5051",
|
||||
|
|
Loading…
Reference in New Issue
Block a user