doc.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Licensed to Elasticsearch B.V. under one or more contributor
  2. // license agreements. See the NOTICE file distributed with
  3. // this work for additional information regarding copyright
  4. // ownership. Elasticsearch B.V. licenses this file to you under
  5. // the Apache License, Version 2.0 (the "License"); you may
  6. // not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing,
  12. // software distributed under the License is distributed on an
  13. // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. // KIND, either express or implied. See the License for the
  15. // specific language governing permissions and limitations
  16. // under the License.
  17. /*
  18. Package estransport provides the transport layer for the Elasticsearch client.
  19. It is automatically included in the client provided by the github.com/elastic/go-elasticsearch package
  20. and is not intended for direct use: to configure the client, use the elasticsearch.Config struct.
  21. The default HTTP transport of the client is http.Transport; use the Transport option to customize it;
  22. see the _examples/coniguration.go and _examples/customization.go files in this repository for information.
  23. The package will automatically retry requests on network-related errors, and on specific
  24. response status codes (by default 502, 503, 504). Use the RetryOnStatus option to customize the list.
  25. The transport will not retry a timeout network error, unless enabled by setting EnableRetryOnTimeout to true.
  26. Use the MaxRetries option to configure the number of retries, and set DisableRetry to true
  27. to disable the retry behaviour altogether.
  28. By default, the retry will be performed without any delay; to configure a backoff interval,
  29. implement the RetryBackoff option function; see an example in the package unit tests for information.
  30. When multiple addresses are passed in configuration, the package will use them in a round-robin fashion,
  31. and will keep track of live and dead nodes. The status of dead nodes is checked periodically.
  32. To customize the node selection behaviour, provide a Selector implementation in the configuration.
  33. To replace the connection pool entirely, provide a custom ConnectionPool implementation via
  34. the ConnectionPoolFunc option.
  35. The package defines the Logger interface for logging information about request and response.
  36. It comes with several bundled loggers for logging in text and JSON.
  37. Use the EnableDebugLogger option to enable the debugging logger for connection management.
  38. Use the EnableMetrics option to enable metric collection and export.
  39. */
  40. package estransport