IsValid uses simple heuristics to see whether this key represents an actual instance
()
| 93 | |
| 94 | // IsValid uses simple heuristics to see whether this key represents an actual instance |
| 95 | func (ik *InstanceKey) IsValid() bool { |
| 96 | if ik.Hostname == "_" { |
| 97 | return false |
| 98 | } |
| 99 | if ik.IsDetached() { |
| 100 | return false |
| 101 | } |
| 102 | return len(ik.Hostname) > 0 && ik.Port > 0 |
| 103 | } |
| 104 | |
| 105 | // DetachedKey returns an instance key whose hostname is detached: invalid, but recoverable |
| 106 | func (ik *InstanceKey) DetachedKey() *InstanceKey { |
no test coverage detected