13 JOB_STATE_INVALID = JobState(iota)
14 // Job is pending resolution
16 // Job has completed and has no failures.
18 // Job has completed and has mixed results.
20 // Job has completed and has completely failed.
24 func (js JobState) Finished() bool {
25 if js == JOB_PENDING {
31 func (js JobState) String() (strout string) {
39 case JOB_FAILED_PARTIAL:
40 strout = "PARTIAL_FAIL"
48 func (js JobState) MarshalJSON() (out []byte, err os.Error) {
51 return json.Marshal(strout)
53 return nil, InvalidValueError
56 func (js *JobState) UnmarshalJSON(in []byte) (err os.Error) {
58 err = json.Unmarshal(in, &statestr)
70 *js = JOB_FAILED_PARTIAL
72 return InvalidValueError