template

package
v6.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0 Imports: 5 Imported by: 675

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionMap

type ConditionMap struct {
	Condition *processors.Condition
	Configs   []*common.Config
}

ConditionMap maps a condition to the configs to use when it's triggered

type Event

type Event common.MapStr

Event adapts MapStr to processors.ValuesMap interface

func (Event) GetValue

func (e Event) GetValue(key string) (interface{}, error)

GetValue extracts given key from an Event

type Mapper

type Mapper []*ConditionMap

Mapper maps config templates with conditions, if a match happens on a discover event the given template will be used as config

func NewConfigMapper

func NewConfigMapper(configs MapperSettings) (*Mapper, error)

NewConfigMapper builds a template Mapper from given settings

func (*Mapper) GetConfig

func (c *Mapper) GetConfig(event bus.Event) []*common.Config

GetConfig returns a matching Config if any, nil otherwise

type MapperSettings

type MapperSettings []*struct {
	ConditionConfig *processors.ConditionConfig `config:"condition"`
	Configs         []*common.Config            `config:"config"`
}

MapperSettings holds user settings to build Mapper

Jump to

Keyboard shortcuts

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