Add File Status and Health constants
This commit is contained in:
parent
3aeda54404
commit
0c28cb284b
1 changed files with 42 additions and 0 deletions
|
@ -57,3 +57,45 @@ func (s TaskStatus) String() string {
|
|||
return fmt.Sprintf("%d", int(s))
|
||||
}
|
||||
}
|
||||
|
||||
type FileStatus int
|
||||
|
||||
const (
|
||||
FILE_STATUS_UNKNOWN FileStatus = iota
|
||||
FILE_STATUS_MISSING
|
||||
FILE_STATUS_EXISTS
|
||||
)
|
||||
|
||||
func (s FileStatus) String() string {
|
||||
switch s {
|
||||
case FILE_STATUS_UNKNOWN:
|
||||
return "Unknown"
|
||||
case FILE_STATUS_MISSING:
|
||||
return "Missing"
|
||||
case FILE_STATUS_EXISTS:
|
||||
return "Exists"
|
||||
default:
|
||||
return fmt.Sprintf("%d", int(s))
|
||||
}
|
||||
}
|
||||
|
||||
type FileHealth int
|
||||
|
||||
const (
|
||||
FILE_HEALTH_UNKNOWN FileHealth = iota
|
||||
FILE_HEALTH_DAMAGED
|
||||
FILE_HEALTH_HEALTHY
|
||||
)
|
||||
|
||||
func (s FileHealth) String() string {
|
||||
switch s {
|
||||
case FILE_HEALTH_UNKNOWN:
|
||||
return "Unknown"
|
||||
case FILE_HEALTH_DAMAGED:
|
||||
return "Damaged"
|
||||
case FILE_HEALTH_HEALTHY:
|
||||
return "Healthy"
|
||||
default:
|
||||
return fmt.Sprintf("%d", int(s))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue