24 lines
558 B
Go
24 lines
558 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type Result int32
|
|
|
|
const (
|
|
Testing Result = 0
|
|
NotTested Result = 1
|
|
SystemFailDuringTesting Result = 2
|
|
TimeLimitExceeded Result = 3
|
|
MemoryLimitExceeded Result = 4
|
|
CompilationError Result = 5
|
|
Accepted Result = 6
|
|
)
|
|
|
|
func (result Result) Valid() error {
|
|
switch result {
|
|
case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceede, CompilationError, SystemFailDuringTesting:
|
|
return nil
|
|
}
|
|
return lib.ErrBadResult
|
|
}
|