ConnectedClusterName reports the connected server's cluster name if any
()
| 2636 | |
| 2637 | // ConnectedClusterName reports the connected server's cluster name if any |
| 2638 | func (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 |
no outgoing calls