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

Function WithAddresses

options.go:54–59  ·  view source on GitHub ↗

--- Client-level options --------------------------------------------------- WithAddresses sets the Elasticsearch node addresses. Multiple addresses enable round-robin load balancing and failover. If neither WithAddresses nor WithCloudID is used, the client falls back to the ELASTICSEARCH_URL envir

(addrs ...string)

Source from the content-addressed store, hash-verified

52// If neither WithAddresses nor WithCloudID is used, the client falls back to
53// the ELASTICSEARCH_URL environment variable, then to http://localhost:9200.
54func WithAddresses(addrs ...string) Option {
55 return Option{apply: func(o *clientOptions) error {
56 o.addresses = append(o.addresses, addrs...)
57 return nil
58 }}
59}
60
61// WithCloudID configures the client for Elastic Cloud using the given Cloud ID.
62// See https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html.

Callers 10

TestNew_WithAddressesFunction · 0.85
TestNew_InvalidURLFunction · 0.85
TestClientConfigurationFunction · 0.85
TestProductCheckErrorFunction · 0.85
TestFingerprintFunction · 0.85

Calls

no outgoing calls

Tested by 10

TestNew_WithAddressesFunction · 0.68
TestNew_InvalidURLFunction · 0.68
TestClientConfigurationFunction · 0.68
TestProductCheckErrorFunction · 0.68
TestFingerprintFunction · 0.68