loaders

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 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 WithRegistry added in v0.19.0

func WithRegistry(reg *prometheus.Registry) Option

type TargetLoader

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

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