elasticsearch

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginsRoot = root + ".plugins"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, plugins ...Plugin) (*elasticsearch.Client, error)

func NewClientWithOptions

func NewClientWithOptions(ctx context.Context, o *Options, plugins ...Plugin) (client *elasticsearch.Client, err error)

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

func (l *Logger) RequestBodyEnabled() bool

RequestBodyEnabled makes the client pass request body to logger

func (*Logger) ResponseBodyEnabled

func (l *Logger) ResponseBodyEnabled() bool

RequestBodyEnabled makes the client pass response body to logger

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

func NewOptions() (*Options, error)

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

type Plugin

type Plugin func(context.Context, *elasticsearch.Client) error

Directories

Path Synopsis
examples
plugins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL