Start starts the runloop to watch for config changes
(notifier Notifier)
| 46 | |
| 47 | // Start starts the runloop to watch for config changes |
| 48 | func (m *FileManager) Start(notifier Notifier) error { |
| 49 | m.notifier = notifier |
| 50 | |
| 51 | // update the notifier with a fresh config on start |
| 52 | config, err := m.GetConfig() |
| 53 | if err != nil { |
| 54 | return err |
| 55 | } |
| 56 | notifier.ConfigDidUpdate(config) |
| 57 | |
| 58 | m.watcher.Start(m) |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | // GetConfig reads the yaml file from the disk |
| 63 | func (m *FileManager) GetConfig() (Root, error) { |