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

Method ConnectedClusterName

nats.go:2638–2650  ·  view source on GitHub ↗

ConnectedClusterName reports the connected server's cluster name if any

()

Source from the content-addressed store, hash-verified

2636
2637// ConnectedClusterName reports the connected server's cluster name if any
2638func (nc *Conn) ConnectedClusterName() string {
2639 if nc == nil {
2640 return _EMPTY_
2641 }
2642
2643 nc.mu.RLock()
2644 defer nc.mu.RUnlock()
2645
2646 if nc.status != CONNECTED {
2647 return _EMPTY_
2648 }
2649 return nc.info.Cluster
2650}
2651
2652// ConnectedServerJetStream reports whether the connected server has
2653// JetStream enabled and, if so, its API level. The API level is

Callers 1

TestConnectedServerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestConnectedServerFunction · 0.64