Documentation
¶
Overview ¶
Package watcher implements watcher client lifecycle logic and persistence helpers. It reloads clients, handles incremental auth file changes, and persists updates when supported.
Package watcher implements debounced configuration hot reload. It detects material changes and reloads clients when the config changes.
Package watcher implements auth update dispatching and queue management. It batches, deduplicates, and delivers auth updates to registered consumers.
Package watcher implements fsnotify event handling for config and auth file changes. It normalizes paths, debounces noisy events, and triggers reload/update logic.
Package watcher watches config/auth files and triggers hot reloads. It supports cross-platform fsnotify event handling.
Index ¶
- Constants
- func BuildAPIKeyClients(cfg *config.Config) (int, int, int, int, int)
- type AuthUpdate
- type Watcher
- func (w *Watcher) DispatchRuntimeAuthUpdate(update AuthUpdate) bool
- func (w *Watcher) SetAuthUpdateQueue(queue chan<- AuthUpdate)
- func (w *Watcher) SetConfig(cfg *config.Config)
- func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth
- func (w *Watcher) Start(ctx context.Context) error
- func (w *Watcher) Stop() error
Constants ¶
const ( AuthUpdateActionAdd authUpdateAction = "add" AuthUpdateActionModify authUpdateAction = "modify" AuthUpdateActionDelete authUpdateAction = "delete" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthUpdate ¶
AuthUpdate describes an incremental change to auth configuration.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher manages file watching for configuration and authentication files
func NewWatcher ¶
NewWatcher creates a new file watcher instance
func (*Watcher) DispatchRuntimeAuthUpdate ¶
func (w *Watcher) DispatchRuntimeAuthUpdate(update AuthUpdate) bool
DispatchRuntimeAuthUpdate allows external runtime providers (e.g., websocket-driven auths) to push auth updates through the same queue used by file/config watchers. Returns true if the update was enqueued; false if no queue is configured.
func (*Watcher) SetAuthUpdateQueue ¶
func (w *Watcher) SetAuthUpdateQueue(queue chan<- AuthUpdate)
SetAuthUpdateQueue sets the queue used to emit auth updates.
func (*Watcher) SnapshotCoreAuths ¶
SnapshotCoreAuths converts current clients snapshot into core auth entries.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package diff computes human-readable diffs for auth file field changes.
|
Package diff computes human-readable diffs for auth file field changes. |
|
Package synthesizer provides auth synthesis strategies for the watcher package.
|
Package synthesizer provides auth synthesis strategies for the watcher package. |