index

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BulkIndexStatistics

func BulkIndexStatistics(p *elastic.BulkProcessor) elastic.BulkProcessorStats

BulkIndexStatistics returns access to statistics in an indexing snapshot

func CreateBulkProcessor

func CreateBulkProcessor(ctx context.Context) *elastic.BulkProcessor

CreateBulkProcessor creates an Elastic BulkProcessorService

func CreateBulkProcessorService

func CreateBulkProcessorService() *elastic.BulkProcessorService

CreateBulkProcessorService creates a service instance

func ESClient

func ESClient() *elastic.Client

ESClient creates or returns an ElasticSearch Client. This function should always be used to perform any ElasticSearch action.

func FlushIndexProcesser

func FlushIndexProcesser() error

FlushIndexProcesser flushes all workers and creates a new consistent index snapshot

func IndexReset

func IndexReset(index string) error

func IndexingProcessor

func IndexingProcessor() *elastic.BulkProcessor

IndexingProcessor returns a pointer to the running BulkProcessor

func ListIndexes

func ListIndexes() ([]string, error)

ListIndexes returns a list of all the ElasticSearch Indices.

Types

type BulkProcessor

type BulkProcessor interface {
	Start(ctx context.Context) error
	Stop() error
	Close() error
	Stats() elastic.BulkProcessorStats
	Add(request BulkableRequest)
	Flush() error
}

BulkProcessor is an interface for oliver/elastice BulkProcessor.

type BulkableRequest

type BulkableRequest interface {
	fmt.Stringer
	Source() ([]string, error)
}

BulkableRequest is a generic interface to bulkable requests.

type CustomRetrier

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

CustomRetrier for configuring the retrier for the ElasticSearch client.

func NewCustomRetrier

func NewCustomRetrier() *CustomRetrier

NewCustomRetrier creates custom retrier for elasticsearch

func (*CustomRetrier) Retry

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

Retry defines how the retrier should deal with retrying the elasticsearch connection.

Jump to

Keyboard shortcuts

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