refactor: rename files -> stdin, stdout, stderr
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
张泊明518370910136 2024-03-05 02:02:05 -05:00
parent e128f2eea8
commit 5c15388882
GPG Key ID: D47306D7062CDA9D
4 changed files with 20 additions and 16 deletions

View File

@ -12,12 +12,12 @@ procLimit = 50
copyInCwd = true copyInCwd = true
copyOut = ["stdout", "stderr"] copyOut = ["stdout", "stderr"]
copyOutCached = ["a"] copyOutCached = ["a"]
[[stages.executor.with.default.files]] [stages.executor.with.default.stdin]
content = "" content = ""
[[stages.executor.with.default.files]] [stages.executor.with.default.stdout]
name = "stdout" name = "stdout"
max = 4_096 max = 4_096
[[stages.executor.with.default.files]] [stages.executor.with.default.stderr]
name = "stderr" name = "stderr"
max = 4_096 max = 4_096
[stages.parser] [stages.parser]
@ -39,21 +39,21 @@ copyOut = ["stdout", "stderr"]
[stages.executor.with.default.copyInCached] [stages.executor.with.default.copyInCached]
a = "a" a = "a"
[[stages.executor.with.cases]] [[stages.executor.with.cases]]
[[stages.executor.with.cases.files]] [stages.executor.with.cases.stdin]
src = "1.stdin" src = "1.stdin"
[[stages.executor.with.cases.files]] [stages.executor.with.cases.stdout]
name = "stdout" name = "stdout"
max = 4_096 max = 4_096
[[stages.executor.with.cases.files]] [stages.executor.with.cases.stderr]
name = "stderr" name = "stderr"
max = 4_096 max = 4_096
[[stages.executor.with.cases]] [[stages.executor.with.cases]]
[[stages.executor.with.cases.files]] [stages.executor.with.cases.stdin]
src = "2.stdin" src = "2.stdin"
[[stages.executor.with.cases.files]] [stages.executor.with.cases.stdout]
name = "stdout" name = "stdout"
max = 4_096 max = 4_096
[[stages.executor.with.cases.files]] [stages.executor.with.cases.stderr]
name = "stderr" name = "stderr"
max = 4_096 max = 4_096
[stages.parser] [stages.parser]

View File

@ -24,7 +24,9 @@ type Conf struct {
type OptionalCmd struct { type OptionalCmd struct {
Args *[]string Args *[]string
Env *[]string Env *[]string
Files *[]*stage.CmdFile Stdin *stage.CmdFile
Stdout *stage.CmdFile
Stderr *stage.CmdFile
CPULimit *uint64 CPULimit *uint64
RealCPULimit *uint64 RealCPULimit *uint64

View File

@ -17,7 +17,7 @@ func convertPBCmd(cmd []stage.Cmd) []*pb.Request_CmdType {
Args: c.Args, Args: c.Args,
Env: c.Env, Env: c.Env,
Tty: c.TTY, Tty: c.TTY,
Files: convertPBFiles(c.Files), Files: convertPBFiles([]*stage.CmdFile{c.Stdin, c.Stdout, c.Stderr}),
CpuTimeLimit: c.CPULimit, CpuTimeLimit: c.CPULimit,
ClockTimeLimit: c.ClockLimit, ClockTimeLimit: c.ClockLimit,
MemoryLimit: c.MemoryLimit, MemoryLimit: c.MemoryLimit,

View File

@ -32,7 +32,9 @@ type CmdFile struct {
type Cmd struct { type Cmd struct {
Args []string `json:"args"` Args []string `json:"args"`
Env []string `json:"env,omitempty"` Env []string `json:"env,omitempty"`
Files []*CmdFile `json:"files,omitempty"` Stdin *CmdFile `json:"stdin,omitempty"`
Stdout *CmdFile `json:"stdout,omitempty"`
Stderr *CmdFile `json:"stderr,omitempty"`
CPULimit uint64 `json:"cpuLimit"` CPULimit uint64 `json:"cpuLimit"`
RealCPULimit uint64 `json:"realCpuLimit"` RealCPULimit uint64 `json:"realCpuLimit"`