Include humanized target state strings.

In the current /status implementation, we cannot divine what the
target's state is but rather get an integer constant for it.  This
commit, stringifies the constants.
This commit is contained in:
Matt T. Proud 2013-03-21 11:52:42 +01:00
parent 8358e5ee44
commit 5a9417f80a
1 changed files with 13 additions and 0 deletions

View File

@ -28,6 +28,19 @@ const (
// The state of the given Target.
type TargetState int
func (t TargetState) String() string {
switch t {
case UNKNOWN:
return "UNKNOWN"
case ALIVE:
return "ALIVE"
case UNREACHABLE:
return "UNREACHABLE"
}
panic("unknown state")
}
const (
// The Target has not been seen; we know nothing about it, except that it is
// on our docket for examination.