watcher

package
v0.104.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Source  EventSource
	Watcher Watcher
}

type EventSource

type EventSource int
const (
	EventSourceConfigMap EventSource = iota
	EventSourcePrometheusCR
)

func (EventSource) String

func (e EventSource) String() string

type PrometheusCRWatcher

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

func NewPrometheusCRWatcher

func NewPrometheusCRWatcher(ctx context.Context, logger logr.Logger, cfg allocatorconfig.Config) (*PrometheusCRWatcher, error)

func (*PrometheusCRWatcher) Close

func (w *PrometheusCRWatcher) Close() error

func (*PrometheusCRWatcher) LoadConfig

func (w *PrometheusCRWatcher) LoadConfig(ctx context.Context) (*promconfig.Config, error)

func (*PrometheusCRWatcher) Watch

func (w *PrometheusCRWatcher) Watch(upstreamEvents chan Event, upstreamErrors chan error) error

Watch wrapped informers and wait for an initial sync.

type Watcher

type Watcher interface {
	// Watch watcher and supply channels which will receive change events
	Watch(upstreamEvents chan Event, upstreamErrors chan error) error
	LoadConfig(ctx context.Context) (*promconfig.Config, error)
	Close() error
}

Jump to

Keyboard shortcuts

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