SetConfigPath sets new config file path Checks for empty string, os null device, or special path, all of which indicates in-memory config.
(path string)
| 324 | // |
| 325 | // Checks for empty string, os null device, or special path, all of which indicates in-memory config. |
| 326 | func SetConfigPath(path string) (err error) { |
| 327 | var cfgPath string |
| 328 | if path == "" || path == os.DevNull { |
| 329 | cfgPath = "" |
| 330 | } else if filepath.Base(path) == noConfigFile { |
| 331 | cfgPath = "" |
| 332 | } else if err = file.IsReserved(path); err != nil { |
| 333 | return err |
| 334 | } else if cfgPath, err = filepath.Abs(path); err != nil { |
| 335 | return err |
| 336 | } |
| 337 | configPath = cfgPath |
| 338 | return nil |
| 339 | } |
| 340 | |
| 341 | // SetData sets new config file storage |
| 342 | func SetData(newData Storage) { |
searching dependent graphs…