MCPcopy
hub / github.com/github/gh-ost / IsValid

Method IsValid

go/mysql/instance_key.go:95–103  ·  view source on GitHub ↗

IsValid uses simple heuristics to see whether this key represents an actual instance

()

Source from the content-addressed store, hash-verified

93
94// IsValid uses simple heuristics to see whether this key represents an actual instance
95func (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
106func (ik *InstanceKey) DetachedKey() *InstanceKey {

Callers 1

Calls 1

IsDetachedMethod · 0.95

Tested by

no test coverage detected