config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPRoundTripper

func GetHTTPRoundTripper(c *Configuration, logger *zap.Logger) (http.RoundTripper, error)

GetHTTPRoundTripper returns configured http.RoundTripper

Types

type ClientBuilder

type ClientBuilder interface {
	NewClient(logger *zap.Logger, metricsFactory metrics.Factory) (es.Client, error)
	GetRemoteReadClusters() []string
	GetMaxDocCount() int
	GetIndexPrefix() string
	GetTokenFilePath() string
	IsStorageEnabled() bool
	GetVersion() uint
	GetLogLevel() string
}

ClientBuilder creates new es.Client

type Configuration

type Configuration struct {
	Servers               []string       `mapstructure:"server_urls"`
	RemoteReadClusters    []string       `mapstructure:"remote_read_clusters"`
	Username              string         `mapstructure:"username"`
	Password              string         `mapstructure:"password" json:"-"`
	TokenFilePath         string         `mapstructure:"token_file"`
	AllowTokenFromContext bool           `mapstructure:"-"`
	Sniffer               bool           `mapstructure:"sniffer"` // https://github.com/olivere/elastic/wiki/Sniffing
	SnifferTLSEnabled     bool           `mapstructure:"sniffer_tls_enabled"`
	MaxDocCount           int            `mapstructure:"-"` // Defines maximum number of results to fetch from storage per query
	Timeout               time.Duration  `validate:"min=500" mapstructure:"-"`
	BulkSize              int            `mapstructure:"-"`
	BulkWorkers           int            `mapstructure:"-"`
	BulkActions           int            `mapstructure:"-"`
	BulkFlushInterval     time.Duration  `mapstructure:"-"`
	IndexPrefix           string         `mapstructure:"index_prefix"`
	Enabled               bool           `mapstructure:"-"`
	TLS                   tlscfg.Options `mapstructure:"tls"`
	Version               uint           `mapstructure:"version"`
	LogLevel              string         `mapstructure:"log_level"`
}

Configuration describes the configuration properties needed to connect to an ElasticSearch cluster

func (*Configuration) ApplyDefaults

func (c *Configuration) ApplyDefaults(source *Configuration)

ApplyDefaults copies settings from source unless its own value is non-zero.

func (*Configuration) GetIndexPrefix

func (c *Configuration) GetIndexPrefix() string

GetIndexPrefix returns index prefix

func (*Configuration) GetLogLevel

func (c *Configuration) GetLogLevel() string

GetLogLevel returns the log-level the ES client should log at.

func (*Configuration) GetMaxDocCount

func (c *Configuration) GetMaxDocCount() int

GetMaxDocCount returns the maximum number of documents that a query should return

func (*Configuration) GetRemoteReadClusters

func (c *Configuration) GetRemoteReadClusters() []string

GetRemoteReadClusters returns list of remote read clusters

func (*Configuration) GetTokenFilePath

func (c *Configuration) GetTokenFilePath() string

GetTokenFilePath returns file path containing the bearer token

func (*Configuration) GetVersion

func (c *Configuration) GetVersion() uint

GetVersion returns Elasticsearch version

func (*Configuration) IsStorageEnabled

func (c *Configuration) IsStorageEnabled() bool

IsStorageEnabled determines whether storage is enabled

func (*Configuration) NewClient

func (c *Configuration) NewClient(logger *zap.Logger, metricsFactory metrics.Factory) (es.Client, error)

NewClient creates a new ElasticSearch client

Jump to

Keyboard shortcuts

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