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

Function WithAPIKey

options.go:114–116  ·  view source on GitHub ↗

--- Convenience transport options ------------------------------------------ These delegate to elastictransport options so callers don't need to import the transport package for common settings. WithAPIKey configures API Key authentication. The key should be the base64-encoded value returned by the

(apiKey string)

Source from the content-addressed store, hash-verified

112// WithAPIKey configures API Key authentication. The key should be the
113// base64-encoded value returned by the Elasticsearch create API key endpoint.
114func WithAPIKey(apiKey string) Option {
115 return withTransportOption(elastictransport.WithAPIKey(apiKey))
116}
117
118// WithBasicAuth configures HTTP Basic Authentication with the given username
119// and password.

Callers 1

TestNew_WithAPIKeyFunction · 0.85

Calls 1

withTransportOptionFunction · 0.85

Tested by 1

TestNew_WithAPIKeyFunction · 0.68