Documentation ¶
Index ¶
- Constants
- func ConfigAdd(path string)
- func NewClient(ctx context.Context, plugins ...Plugin) (*elasticsearch.Client, error)
- func NewClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*elasticsearch.Client, error)
- func NewClientWithOptions(ctx context.Context, o *Options, plugins ...Plugin) (client *elasticsearch.Client, err error)
- type Logger
- type ManagedClient
- func NewManagedClient(ctx context.Context, plugins ...Plugin) (*ManagedClient, error)
- func NewManagedClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*ManagedClient, error)
- func NewManagedClientWithOptions(ctx context.Context, opts *Options, plugins ...Plugin) (*ManagedClient, error)
- type Options
- type Plugin
Constants ¶
View Source
const (
PluginsRoot = root + ".plugins"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct { }
Logger implements the estransport.Logger interface.
func (*Logger) LogRoundTrip ¶
func (l *Logger) LogRoundTrip( req *http.Request, res *http.Response, err error, start time.Time, dur time.Duration, ) error
LogRoundTrip prints the information about request and response.
func (*Logger) RequestBodyEnabled ¶
RequestBodyEnabled makes the client pass request body to logger.
func (*Logger) ResponseBodyEnabled ¶
RequestBodyEnabled makes the client pass response body to logger.
type ManagedClient ¶
ManagedClient struct that represents a managed client.
func NewManagedClient ¶
func NewManagedClient(ctx context.Context, plugins ...Plugin) (*ManagedClient, error)
NewManagedClient returns a managed client with default options.
func NewManagedClientWithConfigPath ¶
func NewManagedClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*ManagedClient, error)
NewManagedClientWithConfigPath returns a managed client with options from config path.
func NewManagedClientWithOptions ¶
func NewManagedClientWithOptions(ctx context.Context, opts *Options, plugins ...Plugin) (*ManagedClient, error)
NewManagedClientWithOptions returns a managed client with options.
type Options ¶
type Options struct { Addresses []string Username string Password string CloudID string `config:"cloudID"` APIKey string `config:"APIKey"` CACert string `config:"CACert"` RetryOnStatus []int DisableRetry bool EnableRetryOnTimeout bool MaxRetries int DiscoverNodesOnStart bool DiscoverNodesInterval time.Duration EnableMetrics bool EnableDebugLogger bool RetryBackoff time.Duration }
func NewOptions ¶
NewOptions returns options from config file or environment vars.
func NewOptionsWithPath ¶
NewOptionsWithPath unmarshals a given key path into options and returns it.
Click to show internal directories.
Click to hide internal directories.