es

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HighConfidence           = 1.0
	MediumConfidence         = 0.75
	LowConfidence            = 0.5
	NoConfidence             = 0.0
	HighNegationConfidence   = -1.0
	MediumNegationConfidence = -0.75
	LowNegationConfidence    = -0.5

	PreviewSize = 256
)

Variables

This section is empty.

Functions

func Initialize

func Initialize(logger zerolog.Logger, url, index string, sizeField bool) (
	context.Context, context.CancelFunc, *retryablehttp.Client, *elastic.Client, *elastic.BulkProcessor, errors.E,
)

func Progress

func Progress(logger zerolog.Logger, processor *elastic.BulkProcessor, cache *Cache, skipped *int64, description string) func(ctx context.Context, p x.Progress)

Types

type Cache

type Cache struct {
	*lru.Cache
	// contains filtered or unexported fields
}

Cache is a LRU cache which counts cache misses.

func NewCache

func NewCache(size int) (*Cache, errors.E)

func (*Cache) Get

func (c *Cache) Get(key interface{}) (interface{}, bool)

func (*Cache) MissCount

func (c *Cache) MissCount() uint64

MissCount returns the number of cache misses since the last call of MissCount (or since the initialization of the cache).

Jump to

Keyboard shortcuts

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