MCPcopy Create free account
hub / github.com/DoNewsCode/core / WithWatcher

Function WithWatcher

config/config.go:47–51  ·  view source on GitHub ↗

WithWatcher is an option for *KoanfAdapter that adds a config watcher. The watcher should notify the configurations whenever a reload event is triggered.

(watcher contract.ConfigWatcher)

Source from the content-addressed store, hash-verified

45// WithWatcher is an option for *KoanfAdapter that adds a config watcher. The watcher should notify the configurations
46// whenever a reload event is triggered.
47func WithWatcher(watcher contract.ConfigWatcher) Option {
48 return func(option *KoanfAdapter) {
49 option.watcher = watcher
50 }
51}
52
53// WithDelimiter changes the default delimiter of Koanf. See Koanf's doc to learn more about delimiters.
54func WithDelimiter(delimiter string) Option {

Callers 3

ProvideConfigFunction · 0.92
TestKoanfAdapter_WatchFunction · 0.85
TestModule_WatchFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestKoanfAdapter_WatchFunction · 0.68
TestModule_WatchFunction · 0.68