MCPcopy
hub / github.com/nats-io/nats.go / ConnectedServerName

Method ConnectedServerName

nats.go:2577–2589  ·  view source on GitHub ↗

ConnectedServerName reports the connected server's name

()

Source from the content-addressed store, hash-verified

2575
2576// ConnectedServerName reports the connected server's name
2577func (nc *Conn) ConnectedServerName() string {
2578 if nc == nil {
2579 return _EMPTY_
2580 }
2581
2582 nc.mu.RLock()
2583 defer nc.mu.RUnlock()
2584
2585 if nc.status != CONNECTED {
2586 return _EMPTY_
2587 }
2588 return nc.info.Name
2589}
2590
2591var semVerRe = regexp.MustCompile(`\Av?([0-9]+)\.?([0-9]+)?\.?([0-9]+)?`)
2592

Callers 1

TestConnectedServerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestConnectedServerFunction · 0.64