loaders

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Loaders = map[string]Initializer{}
View Source
var LoadersTypes = []string{
	"file",
	"consul",
	"docker",
	"http",
}

Functions

func DecodeConfig

func DecodeConfig(src, dst interface{}) error

func Register

func Register(name string, initFn Initializer)

Types

type Initializer

type Initializer func() TargetLoader

type Option added in v0.19.0

type Option func(TargetLoader)

func WithActions added in v0.21.0

func WithActions(acts map[string]map[string]interface{}) Option

func WithRegistry added in v0.19.0

func WithRegistry(reg *prometheus.Registry) Option

func WithTargetsDefaults added in v0.21.0

func WithTargetsDefaults(fn func(tc *types.TargetConfig) error) Option

type TargetLoader

type TargetLoader interface {
	Init(context.Context, map[string]interface{}, *log.Logger, ...Option) error
	Start(context.Context) chan *TargetOperation
	RegisterMetrics(*prometheus.Registry)
	WithActions(map[string]map[string]interface{})
	WithTargetsDefaults(func(tc *types.TargetConfig) error)
}

type TargetOperation

type TargetOperation struct {
	Add []*types.TargetConfig
	Del []string
}

func Diff

func Diff(m1, m2 map[string]*types.TargetConfig) *TargetOperation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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