watcher

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(
		fx.Annotate(
			func(cfg *config.Configuration, logger zerolog.Logger) (Watcher, error) {
				if cfg.SecretsReloadEnabled {
					return newWatcher(logger)
				}

				return &NoopWatcher{}, nil
			},

			fx.OnStart(func(ctx context.Context, w Watcher) error {
				w.(controller).start(ctx)

				return nil
			}),

			fx.OnStop(func(ctx context.Context, w Watcher) error { return w.(controller).stop(ctx) }),
		),
	),
)

Module is used on app bootstrap. nolint: gochecknoglobals

Functions

This section is empty.

Types

type ChangeListener

type ChangeListener interface {
	OnChanged(logger zerolog.Logger)
}

type NoopWatcher

type NoopWatcher struct{}

func (*NoopWatcher) Add

type Watcher

type Watcher interface {
	Add(path string, cl ChangeListener) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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