elastic

package
v0.0.0-...-0d40728 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCtor

type ClientCtor func() (*elastic.Client, error)

ClientCtor repressents a client constructor to instantiate an elasticsearch client.

func NewClient

func NewClient(endpoint string, debug bool) ClientCtor

NewClient instantiates and returns a new elasticsearch client constructor.

type Retrier

type Retrier struct {
	// contains filtered or unexported fields
}

Retrier defined a constant backoff retry strategy for the elastic connection.

func NewRetrier

func NewRetrier(retries int, intervalMs time.Duration) *Retrier

NewRetrier creates a the elastic client connection retries. It will attempt to connect every intervalMs milliseconds up to a maximum of retries attempts.

func (*Retrier) Retry

func (r *Retrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error)

Retry is called when an attempted connection to the elastic client has failed.

Jump to

Keyboard shortcuts

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