configwatcher

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 6 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 {
	// contains filtered or unexported fields
}

ConfigWatcher watches config files and calls OnChange when modifications are detected.

func New

func New(opts ...Option) *ConfigWatcher

func (*ConfigWatcher) Init

func (w *ConfigWatcher) Init(app modular.Application) error

Init satisfies the modular.Module interface. Captures the application logger if one was not provided via WithLogger.

func (*ConfigWatcher) Name

func (w *ConfigWatcher) Name() string

func (*ConfigWatcher) Start

func (w *ConfigWatcher) Start(ctx context.Context) error

func (*ConfigWatcher) Stop

func (w *ConfigWatcher) Stop(_ context.Context) error

type Option

type Option func(*ConfigWatcher)

Option configures a ConfigWatcher.

func WithDebounce

func WithDebounce(d time.Duration) Option

func WithLogger

func WithLogger(l modular.Logger) Option

func WithOnChange

func WithOnChange(fn func(paths []string)) Option

func WithPaths

func WithPaths(paths ...string) Option

Jump to

Keyboard shortcuts

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