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

Function WithYamlFile

c.go:90–93  ·  view source on GitHub ↗

WithYamlFile is a two-in-one coreOption. It uses the configuration file as the source of configuration, and watches the change of that file for hot reloading.

(path string)

Source from the content-addressed store, hash-verified

88// WithYamlFile is a two-in-one coreOption. It uses the configuration file as the
89// source of configuration, and watches the change of that file for hot reloading.
90func WithYamlFile(path string) (CoreOption, CoreOption) {
91 return WithConfigStack(file.Provider(path), config.CodecParser{Codec: yaml.Codec{}}),
92 WithConfigWatcher(watcher.File{Path: path})
93}
94
95// WithInline is a CoreOption that creates a inline config in the configuration stack.
96func WithInline(key string, entry interface{}) CoreOption {

Callers

nothing calls this directly

Calls 2

WithConfigStackFunction · 0.85
WithConfigWatcherFunction · 0.85

Tested by

no test coverage detected