lutool

package
v0.0.0-...-53b130a Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCacheConfig = CacheConfig{
	Backoff: BackoffConfig{
		Duration: 1 * time.Second,
		Factor:   2.0,
		Max:      60 * time.Second,
	},
	GCInterval:      10 * time.Second,
	ExpireUnused:    60 * time.Second,
	FieldsUnderRoot: false,
}

Functions

func NewCachedLookupTool

func NewCachedLookupTool(
	name string,
	config CacheConfig,
	keyBuilder KeyBuilder,
	backend Runner,
) (processors.Processor, error)

Types

type BackoffConfig

type BackoffConfig struct {
	Duration time.Duration `config:"duration" validate:"min=0"`
	Factor   float64       `config:"factor"   validate:"min=1.0"`
	Max      time.Duration `config:"max"      validate:"min=0"`
}

type CacheConfig

type CacheConfig struct {
	Backoff         BackoffConfig `config:"backoff"`
	GCInterval      time.Duration `config:"gc_interval"       validate:"min=0s"`
	ExpireUnused    time.Duration `config:"expire_unused"     validate:"min=1s"`
	FieldsUnderRoot bool          `config:"fields_under_root"`
}

type Key

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

func (*Key) Equals

func (k *Key) Equals(o *Key) bool

func (*Key) Hash

func (k *Key) Hash(h hash.Hash64) error

type KeyBuilder

type KeyBuilder interface {
	ExtractKey(common.MapStr) (Key, bool)
}

func MakeKeyBuilder

func MakeKeyBuilder(fields []string) (KeyBuilder, error)

type KeyBuilderFunc

type KeyBuilderFunc func(common.MapStr) (Key, bool)

func (KeyBuilderFunc) ExtractKey

func (fn KeyBuilderFunc) ExtractKey(event common.MapStr) (Key, bool)

type Runner

type Runner interface {
	Exec(common.MapStr) (common.MapStr, error)
}

Jump to

Keyboard shortcuts

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