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

Method Servers

nats.go:6229–6233  ·  view source on GitHub ↗

Servers returns the list of known server urls, including additional servers 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

6227// authentication is enabled, use UserInfo or Token when connecting with
6228// these urls.
6229func (nc *Conn) Servers() []string {
6230 nc.mu.RLock()
6231 defer nc.mu.RUnlock()
6232 return nc.getServers(false)
6233}
6234
6235// DiscoveredServers returns only the server urls that have been discovered
6236// after a connection has been established. If authentication is enabled,

Callers 6

TestAsyncINFOFunction · 0.95
TestConnServersFunction · 0.95
TestWSGossipAndReconnectFunction · 0.80

Calls 1

getServersMethod · 0.95

Tested by 6

TestAsyncINFOFunction · 0.76
TestConnServersFunction · 0.76
TestWSGossipAndReconnectFunction · 0.64