Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type YAMLHotReloader ¶
type YAMLHotReloader struct {
// contains filtered or unexported fields
}
YAMLHotReloader is a hot reload implementation for YAML configuration files. It watches for file changes and automatically reloads the configuration.
func NewYAMLHotReloader ¶
func NewYAMLHotReloader(path string, initialConfig any, logger *slog.Logger) (*YAMLHotReloader, error)
NewYAMLHotReloader creates a new YAML hot reloader. The initialConfig must be a pointer to a struct that will be unmarshaled from YAML.
func (*YAMLHotReloader) Close ¶
func (h *YAMLHotReloader) Close() error
Close stops the file watcher and releases resources.
func (*YAMLHotReloader) Get ¶
func (h *YAMLHotReloader) Get() any
Get returns the current configuration.
func (*YAMLHotReloader) OnReload ¶
func (h *YAMLHotReloader) OnReload(fn func(any))
OnReload sets the callback function that will be called when the config is reloaded.
Click to show internal directories.
Click to hide internal directories.