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

Method DiscoveredServers

nats.go:6238–6242  ·  view source on GitHub ↗

DiscoveredServers returns only the server urls that have been discovered after a connection has been established. If authentication is enabled, use UserInfo or Token when connecting with these urls.

()

Source from the content-addressed store, hash-verified

6236// after a connection has been established. If authentication is enabled,
6237// use UserInfo or Token when connecting with these urls.
6238func (nc *Conn) DiscoveredServers() []string {
6239 nc.mu.RLock()
6240 defer nc.mu.RUnlock()
6241 return nc.getServers(true)
6242}
6243
6244// Status returns the current state of the connection.
6245func (nc *Conn) Status() Status {

Callers 7

TestConnServersFunction · 0.95
TestLameDuckModeFunction · 0.80
TestReconnectTLSHostNoIPFunction · 0.80

Calls 1

getServersMethod · 0.95

Tested by 7

TestConnServersFunction · 0.76
TestLameDuckModeFunction · 0.64
TestReconnectTLSHostNoIPFunction · 0.64