autodiscover

package
v6.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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