Browse Source

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.
pull/90/head
Matt T. Proud 12 years ago
parent
commit
5a9417f80a
  1. 13
      retrieval/target.go

13
retrieval/target.go

@ -28,6 +28,19 @@ const (
// The state of the given Target. // The state of the given Target.
type TargetState int 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 ( const (
// The Target has not been seen; we know nothing about it, except that it is // The Target has not been seen; we know nothing about it, except that it is
// on our docket for examination. // on our docket for examination.

Loading…
Cancel
Save