Documentation
¶
Overview ¶
Package watcher watches the config file and auth directory for changes and triggers hot reload callbacks.
This is a simplified fsnotify-based watcher aligned with CLIProxyAPI's hot reload behavior: - Watch the parent directory of the config file (robust against atomic save/rename). - Watch the auth-dir directory for *.json changes (add/modify/remove/rename). - Debounce noisy event bursts and reload based on current filesystem state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct {
// OnConfigReload is invoked after the config file is reloaded successfully.
OnConfigReload func(ctx context.Context, cfg *config.Config)
// OnConfigYAMLChange is invoked when the config file content changes (raw YAML bytes).
// It is called even if the updated config cannot be parsed successfully.
OnConfigYAMLChange func(ctx context.Context, data []byte)
// OnAuthChange is invoked when auth-dir content changes and should be reloaded.
OnAuthChange func(ctx context.Context)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package synthesizer provides auth synthesis strategies for the watcher package.
|
Package synthesizer provides auth synthesis strategies for the watcher package. |
Click to show internal directories.
Click to hide internal directories.