mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-16 11:50:39 +08:00
27 lines
387 B
Go
27 lines
387 B
Go
package v1
|
|
|
|
type NodeStatus int
|
|
|
|
func (c NodeStatus) IsValid() bool { return c >= Pending && c <= Failed }
|
|
|
|
func (c NodeStatus) String() string {
|
|
switch c {
|
|
case Pending:
|
|
return "Pending"
|
|
case Processing:
|
|
return "Processing"
|
|
case Completed:
|
|
return "Completed"
|
|
case Failed:
|
|
return "Failed"
|
|
}
|
|
return ""
|
|
}
|
|
|
|
const (
|
|
Pending NodeStatus = iota
|
|
Processing
|
|
Completed
|
|
Failed
|
|
)
|