configwatcher

package
v0.0.0-...-a605f52 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigWatcher

type ConfigWatcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ConfigWatcher watches changes to the configuration at the given path. It reads and parses the config on update to the file

func New

func New(log logr.Logger, configpath string) (*ConfigWatcher, error)

New returns a new watcher that watches the given config

func (*ConfigWatcher) GetConfiguration

func (cw *ConfigWatcher) GetConfiguration() *config.Configuration

func (*ConfigWatcher) InjectNotifyFunc

func (cw *ConfigWatcher) InjectNotifyFunc(f NotifyFunc)

InjectReconciler injects a reconciler to the watches that is called when the config changes

func (*ConfigWatcher) ReadConfiguration

func (cw *ConfigWatcher) ReadConfiguration() error

ReadConfiguration reads the configuration from the file system

func (*ConfigWatcher) Start

func (cw *ConfigWatcher) Start(stopCh <-chan struct{}) error

Start starts the watch on the certificate and key files.

func (*ConfigWatcher) Watch

func (cw *ConfigWatcher) Watch()

Watch reads events from the watcher's channel and reacts to changes.

type NotifyFunc

type NotifyFunc = func(ctx context.Context, configuration *config.Configuration) error

Jump to

Keyboard shortcuts

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