Documentation
¶
Overview ¶
Package main demonstrates configx Watch hot reload.
Run:
go run ./examples/configx-watch
The example writes a config file, loads it, registers a Watch callback on log.level, then rewrites the file to trigger a reload. The callback prints the new level.
Expected output (timing may vary):
loaded config: log.level=info watching log.level... (rewrite the file to trigger reload) rewrote file: log.level=debug reload detected: log.level=debug done
Click to show internal directories.
Click to hide internal directories.