internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(retry, timeout int) *retryablehttp.Client

func NewElasticClient

func NewElasticClient(cfg *ElasticConfig) (*elasticsearch.Client, error)

NewElasticClient returns a github.com/elastic/go-elasticsearch client.

func NewOlivereClient

func NewOlivereClient(cfg *OlivereConfig) *elastic.Client

Types

type ElasticConfig

type ElasticConfig struct {
	Urls       []string
	Client     *http.Client
	UserName   string
	Password   string
	Logger     *logger.CustomLogger
	Metrics    bool
	MaxRetries int
	FastHTTP   bool
	Timeout    int
}

type OlivereConfig

type OlivereConfig struct {
	Urls             []string
	Logger           *zerolog.Logger
	TimeoutInSeconds int // only respected when Client == nil
	HTTPRetries      int // only respected when Client == nil
	Client           *http.Client
	UserName         string
	Password         string
	EnableTrace      bool
	EnableInfo       bool
}

func (*OlivereConfig) HasAuthentication

func (cfg *OlivereConfig) HasAuthentication() bool

type Transport

type Transport struct{}

Transport implements the estransport interface with the github.com/valyala/fasthttp HTTP client.

adapted from https://github.com/elastic/go-elasticsearch/blob/master/_examples/fasthttp/fasthttp.go

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip performs the request and returns a response or error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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