Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AppGeneratorSubCommands = cli.Commands{ { Name: "config", HelpName: "deer-executor example config", Action: generate.MakeProblemConfigFile, Usage: "generate problem config file", Flags: []cli.Flag{ &cli.StringFlag{ Name: "output", Aliases: []string{"out"}, Value: "", Usage: "output config file", }, }, }, { Name: "compiler", HelpName: "deer-executor example compiler", Action: generate.MakeCompileConfigFile, Usage: "generate compiler settings file", Flags: []cli.Flag{ &cli.StringFlag{ Name: "output", Aliases: []string{"out"}, Value: "", Usage: "output config file", }, }, }, { Name: "jit_memory", HelpName: "deer-executor example jit_memory", Action: generate.MakeJITMemoryConfigFile, Usage: "generate jit memory limitation settings file", Flags: []cli.Flag{ &cli.StringFlag{ Name: "output", Aliases: []string{"out"}, Value: "", Usage: "output config file", }, }, }, }
AppGeneratorSubCommands for commands 'gen'
View Source
var AppPackageSubCommands = cli.Commands{ { Name: "build", HelpName: "deer-executor package build", Usage: "build problem package", ArgsUsage: "<configs_file> <output_file>", Flags: PackProblemFlags, Action: packmgr.BuildProblemPackage, }, { Name: "unpack", HelpName: "deer-executor package unpack", Usage: "unpack problem package", ArgsUsage: "<package_file> <output_dir>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "no-validate", Value: false, Usage: "disable package validation", }, }, Action: packmgr.UnpackProblemPackage, }, { Name: "info", HelpName: "deer-executor package info", Usage: "show problem package info", ArgsUsage: "<package_file>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "gpg", Value: false, Usage: "output GPG signature info", }, }, Action: packmgr.ReadProblemInfo, }, }
AppPackageSubCommands for cli command 'pack'
View Source
var AppProblemSubCommands = cli.Commands{ { Name: "build", HelpName: "deer-executor problem build", Aliases: []string{"b"}, Usage: "compile binary source codes", ArgsUsage: "<configs_file>", Flags: []cli.Flag{ &cli.StringFlag{ Name: "library", Aliases: []string{"l"}, Value: "./lib", Usage: "library root for special judge, contains \"testlib.h\" and \"bits/stdc++.h\" etc.", }, }, Action: packmgr.CompileProblemWorkDirSourceCodes, }, { Name: "validate", HelpName: "deer-executor problem validate", Aliases: []string{"v"}, Usage: "run validator cases and test case input", ArgsUsage: "<configs_file>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "silence", Aliases: []string{"s"}, Value: false, Usage: "silence mode", }, &cli.StringFlag{ Name: "type", Aliases: []string{"t"}, Value: "all", Usage: "module type: validator_cases|test_cases|all", }, &cli.IntFlag{ Name: "case", Aliases: []string{"c"}, Value: -1, Usage: "case index, -1 means all. when module type set 'all',it would't work.", }, }, Action: packmgr.RunTestlibValidators, }, { Name: "generate", HelpName: "deer-executor problem generate", Aliases: []string{"gen", "g"}, Usage: "generate test case's input/output", ArgsUsage: "<configs_file>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "silence", Aliases: []string{"s"}, Value: false, Usage: "silence mode", }, &cli.BoolFlag{ Name: "with-answer", Usage: "generate answer", }, &cli.UintFlag{ Name: "answer", Value: 0, Usage: "answer case index.", }, &cli.IntFlag{ Name: "case", Aliases: []string{"c"}, Value: -1, Usage: "case index, -1 means all. when module type set 'all',it would't work.", }, }, Action: packmgr.RunTestCaseGenerator, }, { Name: "checker", HelpName: "deer-executor problem checker", Aliases: []string{"c"}, Usage: "run checker cases", ArgsUsage: "<configs_file>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "silence", Aliases: []string{"s"}, Value: false, Usage: "silence mode", }, &cli.UintFlag{ Name: "answer", Aliases: []string{"a"}, Value: 0, Usage: "answer case index.", }, &cli.IntFlag{ Name: "case", Aliases: []string{"c"}, Value: -1, Usage: "case index, -1 means all. when module type set 'all',it would't work.", }, }, Action: packmgr.RunCheckerCases, }, }
AppProblemSubCommands for cli command 'problem'
View Source
var PackProblemFlags = []cli.Flag{ &cli.BoolFlag{ Name: "sign", Aliases: []string{"s"}, Value: false, Usage: "Enable digital sign (GPG)", }, &cli.StringFlag{ Name: "gpg-key", Aliases: []string{"key"}, Value: "", Usage: "GPG private key file", }, &cli.StringFlag{ Name: "passphrase", Aliases: []string{"p", "password", "pwd"}, Value: "", Usage: "GPG private key passphrase", }, &cli.BoolFlag{ Name: "zip", Aliases: []string{"z"}, Value: false, Usage: "Package as a zip file", }, }
PackProblemFlags for cli command 'pack'
View Source
var RunFlags = []cli.Flag{ &cli.BoolFlag{ Name: "no-clean", Value: false, Usage: "Don't delete session directory after judge", }, &cli.StringFlag{ Name: "language", Aliases: []string{"l"}, Value: "auto", Usage: "Code language name", }, &cli.BoolFlag{ Name: "debug", Value: false, Usage: "Print debug log", }, &cli.IntFlag{ Name: "benchmark", Value: 0, Usage: "Start benchmark", }, &cli.StringFlag{ Name: "persistence", Aliases: []string{"p"}, Value: "", Usage: "Persistent judge result to file (support: gzip, none)", }, &cli.BoolFlag{ Name: "save-ac-data", Value: false, Usage: "Persistent an ACCEPTED test case's output data, will increase the file size", }, &cli.StringFlag{ Name: "compress", Value: "gzip", Usage: "Persistent compressor type", }, &cli.BoolFlag{ Name: "sign", Aliases: []string{"s"}, Value: false, Usage: "Enable digital sign (GPG)", }, &cli.BoolFlag{ Name: "detail", Value: false, Usage: "Show test-cases details", }, &cli.StringFlag{ Name: "gpg-key", Aliases: []string{"key"}, Value: "", Usage: "GPG private key file", }, &cli.StringFlag{ Name: "passphrase", Aliases: []string{"password", "pwd"}, Value: "", Usage: "GPG private key passphrase", }, &cli.StringFlag{ Name: "work-dir", Aliases: []string{"w"}, Value: "", Usage: "Working dir, using to unpack problem package", }, &cli.StringFlag{ Name: "session-id", Value: "", Usage: "setup session id", }, &cli.StringFlag{ Name: "session-root", Value: "", Usage: "setup session root dir", }, &cli.StringFlag{ Name: "library", Value: "./lib", Usage: "library root for special judge, contains \"testlib.h\" and \"bits/stdc++.h\" etc.", }, &cli.StringFlag{ Name: "log-level", Value: "", Usage: "set logs level (debug|info|warn|error)", }, &cli.BoolFlag{ Name: "log", Value: false, Usage: "output logs to stdout", }, }
RunFlags for cli command 'run'
Functions ¶
Types ¶
type CliCommonMessage ¶ added in v2.1.0
type CliCommonMessage struct { // 是否错误 Error bool `json:"error"` // 消息 Message string `json:"message"` // 结果信息 Data interface{} `json:"data"` }
CliCommonMessage is a client comment message
func NewCliCommonMessage ¶ added in v2.1.0
func NewCliCommonMessage(error bool, message string, data interface{}) CliCommonMessage
NewCliCommonMessage to create a client comment message
func NewClientErrorMessage ¶ added in v2.1.0
func NewClientErrorMessage(err error, data interface{}) CliCommonMessage
NewClientErrorMessage to create a client error message
func NewClientSuccessMessage ¶ added in v2.1.0
func NewClientSuccessMessage(data interface{}) CliCommonMessage
NewClientSuccessMessage to create a client success message
func NewClientSuccessMessageText ¶ added in v2.1.0
func NewClientSuccessMessageText(message string) CliCommonMessage
NewClientSuccessMessageText to create a new client message with text
func (CliCommonMessage) Print ¶ added in v2.1.0
func (ccm CliCommonMessage) Print(formated bool)
Print print log to stdout
func (CliCommonMessage) ToJSON ¶ added in v2.2.2
func (ccm CliCommonMessage) ToJSON(formated bool) string
ToJSON convert log record to json
Click to show internal directories.
Click to hide internal directories.