allow to override path in save/load/watch

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-11-18 16:05:44 +03:00
parent 65c867a6b4
commit f8b972b51a
4 changed files with 46 additions and 11 deletions

View File

@@ -44,3 +44,15 @@ type timeoutKey struct{}
func Timeout(td time.Duration) config.Option {
return config.SetOption(timeoutKey{}, td)
}
func LoadPath(path string) config.LoadOption {
return config.SetLoadOption(pathKey{}, path)
}
func SavePath(path string) config.SaveOption {
return config.SetSaveOption(pathKey{}, path)
}
func WatchPath(path string) config.WatchOption {
return config.SetWatchOption(pathKey{}, path)
}