MCPcopy
hub / github.com/elastic/go-elasticsearch / DiscoverNodes

Method DiscoverNodes

elasticsearch.go:647–655  ·  view source on GitHub ↗

DiscoverNodes reloads the client connections by fetching information from the cluster.

()

Source from the content-addressed store, hash-verified

645
646// DiscoverNodes reloads the client connections by fetching information from the cluster.
647func (c *BaseClient) DiscoverNodes() error {
648 if c.isClosed() {
649 return ErrClosed
650 }
651 if dt, ok := c.Transport.(elastictransport.Discoverable); ok {
652 return dt.DiscoverNodes()
653 }
654 return errors.New("transport is missing method DiscoverNodes()")
655}
656
657func (c *BaseClient) isClosed() bool {
658 return atomic.LoadUint32(&c.closeDone) != 0

Callers 6

NewBaseClientFunction · 0.95
NewBaseFunction · 0.95
NewClientFunction · 0.80
NewTypedClientFunction · 0.80
NewFunction · 0.80
NewTypedFunction · 0.80

Calls 1

isClosedMethod · 0.95

Tested by

no test coverage detected