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

Method ConnectedServerVersion

nats.go:2623–2635  ·  view source on GitHub ↗

ConnectedServerVersion reports the connected server's version as a string

()

Source from the content-addressed store, hash-verified

2621
2622// ConnectedServerVersion reports the connected server's version as a string
2623func (nc *Conn) ConnectedServerVersion() string {
2624 if nc == nil {
2625 return _EMPTY_
2626 }
2627
2628 nc.mu.RLock()
2629 defer nc.mu.RUnlock()
2630
2631 if nc.status != CONNECTED {
2632 return _EMPTY_
2633 }
2634 return nc.info.Version
2635}
2636
2637// ConnectedClusterName reports the connected server's cluster name if any
2638func (nc *Conn) ConnectedClusterName() string {

Callers 1

serverMinVersionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected