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

Function addrsToURLs

elasticsearch.go:717–728  ·  view source on GitHub ↗

addrsToURLs creates a list of url.URL structures from url list.

(addrs []string)

Source from the content-addressed store, hash-verified

715
716// addrsToURLs creates a list of url.URL structures from url list.
717func addrsToURLs(addrs []string) ([]*url.URL, error) {
718 var urls []*url.URL
719 for _, addr := range addrs {
720 u, err := url.Parse(strings.TrimRight(addr, "/"))
721 if err != nil {
722 return nil, fmt.Errorf("cannot parse URL: %v", err)
723 }
724
725 urls = append(urls, u)
726 }
727 return urls, nil
728}
729
730// addrFromCloudID extracts the Elasticsearch URL from CloudID.
731// See: https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html

Callers 3

resolveOptionsFunction · 0.85
newTransportFunction · 0.85
TestAddrsToURLsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestAddrsToURLsFunction · 0.68