autodiscover

package
v6.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: Apache-2.0 Imports: 9 Imported by: 1,506

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderRegistry = NewRegistry()

ProviderRegistry holds all known autodiscover providers, they must be added to it to enable them for use

Functions

func NewRegistry

func NewRegistry() *registry

NewRegistry creates and returns a new Registry

Types

type Adapter

type Adapter interface {

	// CreateConfig generates a valid list of configs from the given event, the received event will have all keys defined by `StartFilter`
	CreateConfig(bus.Event) ([]*common.Config, error)

	// CheckConfig tests given config to check if it will work or not, returns errors in case it won't work
	CheckConfig(*common.Config) error

	// RunnerFactory provides runner creation by feeding valid configs
	cfgfile.RunnerFactory

	// EventFilter returns the bus filter to retrieve runner start/stop triggering events
	EventFilter() []string
}

Adapter must be implemented by the beat in order to provide Autodiscover

type Autodiscover

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

Autodiscover process, it takes a beat adapter and user config and runs autodiscover process, spawning new modules when any configured providers does a match

func NewAutodiscover

func NewAutodiscover(name string, adapter Adapter, config *Config) (*Autodiscover, error)

NewAutodiscover instantiates and returns a new Autodiscover manager

func (*Autodiscover) Start

func (a *Autodiscover) Start()

Start autodiscover process

func (*Autodiscover) Stop

func (a *Autodiscover) Stop()

Stop autodiscover process

type Config

type Config struct {
	Providers []*common.Config `config:"providers"`
}

Config settings for Autodiscover

type Provider

type Provider interface {
	cfgfile.Runner
}

Provider for autodiscover

type ProviderBuilder

type ProviderBuilder func(bus.Bus, *common.Config) (Provider, error)

ProviderBuilder creates a new provider based on the given config and returns it

type ProviderConfig

type ProviderConfig struct {
	Type string `config:"type"`
}

ProviderConfig settings

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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