legacymanager

package
v0.0.0-...-f8c6d31 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalYAMLWithInlineConfigs

func MarshalYAMLWithInlineConfigs(in interface{}) (interface{}, error)

MarshalYAMLWithInlineConfigs helps implement yaml.Marshal for structs that have a Configs field that should be inlined.

func Name

func Name(n string) func(*Manager)

Name sets the name of the manager.

func RegisterConfig

func RegisterConfig(config discovery.Config)

RegisterConfig registers the given Config type for YAML marshaling and unmarshaling.

func RegisterMetrics

func RegisterMetrics()

func UnmarshalYAMLWithInlineConfigs

func UnmarshalYAMLWithInlineConfigs(out interface{}, unmarshal func(interface{}) error) error

UnmarshalYAMLWithInlineConfigs helps implement yaml.Unmarshal for structs that have a Configs field that should be inlined.

Types

type Manager

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

Manager maintains a set of discovery providers and sends each update to a map channel. Targets are grouped by the target set name.

func NewManager

func NewManager(ctx context.Context, logger log.Logger, options ...func(*Manager)) *Manager

NewManager is the Discovery Manager constructor.

func (*Manager) ApplyConfig

func (m *Manager) ApplyConfig(cfg map[string]discovery.Configs) error

ApplyConfig removes all running discovery providers and starts new ones using the provided config.

func (*Manager) Run

func (m *Manager) Run() error

Run starts the background processing

func (*Manager) StartCustomProvider

func (m *Manager) StartCustomProvider(ctx context.Context, name string, worker discovery.Discoverer)

StartCustomProvider is used for sdtool. Only use this if you know what you're doing.

func (*Manager) SyncCh

func (m *Manager) SyncCh() <-chan map[string][]*targetgroup.Group

SyncCh returns a read only channel used by all the clients to receive target updates.

type StaticProvider

type StaticProvider struct {
	TargetGroups []*targetgroup.Group
}

StaticProvider holds a list of target groups that never change.

func (*StaticProvider) Run

func (sd *StaticProvider) Run(ctx context.Context, ch chan<- []*targetgroup.Group)

Run implements the Worker interface.

Jump to

Keyboard shortcuts

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