Add File Status and Health constants

This commit is contained in:
Samuel Lorch 2024-05-11 00:39:09 +02:00
parent 3aeda54404
commit 0c28cb284b

View file

@ -57,3 +57,45 @@ func (s TaskStatus) String() string {
return fmt.Sprintf("%d", int(s)) 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))
}
}