Wrap wraps an existing Configuration structure and ties it to a file on disk. The returned Wrapper is a suture.Service, thus needs to be started (added to a supervisor).
(path string, cfg Configuration, myID protocol.DeviceID, evLogger events.Logger)
| 145 | // The returned Wrapper is a suture.Service, thus needs to be started (added to |
| 146 | // a supervisor). |
| 147 | func Wrap(path string, cfg Configuration, myID protocol.DeviceID, evLogger events.Logger) Wrapper { |
| 148 | w := &wrapper{ |
| 149 | cfg: cfg, |
| 150 | path: path, |
| 151 | evLogger: evLogger, |
| 152 | myID: myID, |
| 153 | queue: make(chan modifyEntry, maxModifications), |
| 154 | waiter: noopWaiter{}, // Noop until first config change |
| 155 | } |
| 156 | return w |
| 157 | } |
| 158 | |
| 159 | // Load loads an existing file on disk and returns a new configuration |
| 160 | // wrapper. |
no outgoing calls