MCPcopy
hub / github.com/syncthing/syncthing / Wrap

Function Wrap

lib/config/wrapper.go:147–157  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

145// The returned Wrapper is a suture.Service, thus needs to be started (added to
146// a supervisor).
147func 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.

Callers 15

TestIsLANHostFunction · 0.92
initConfigFunction · 0.92
withConnectionPairFunction · 0.92
loadConfigFunction · 0.92
setupCacheFunction · 0.92
TestShortIDCheckFunction · 0.92
TestStartupFailFunction · 0.92
DefaultConfigFunction · 0.92
aggregator_test.goFile · 0.92

Calls

no outgoing calls

Tested by 14

TestIsLANHostFunction · 0.74
initConfigFunction · 0.74
withConnectionPairFunction · 0.74
loadConfigFunction · 0.74
setupCacheFunction · 0.74
TestShortIDCheckFunction · 0.74
TestStartupFailFunction · 0.74
TestHTTPLoginFunction · 0.74
TestConfigChangesFunction · 0.74