MCPcopy Index your code
hub / github.com/syncthing/syncthing / New

Function New

lib/api/api.go:110–135  ·  view source on GitHub ↗
(id protocol.DeviceID, cfg config.Wrapper, assetDir, tlsDefaultCommonName string, m model.Model, defaultSub, diskSub events.BufferedSubscription, evLogger events.Logger, discoverer discover.Manager, connectionsService connections.Service, urService *ur.Service, fss model.FolderSummaryService, errors, systemLog slogutil.Recorder, noUpgrade bool, miscDB *db.Typed)

Source from the content-addressed store, hash-verified

108}
109
110func New(id protocol.DeviceID, cfg config.Wrapper, assetDir, tlsDefaultCommonName string, m model.Model, defaultSub, diskSub events.BufferedSubscription, evLogger events.Logger, discoverer discover.Manager, connectionsService connections.Service, urService *ur.Service, fss model.FolderSummaryService, errors, systemLog slogutil.Recorder, noUpgrade bool, miscDB *db.Typed) Service {
111 return &service{
112 id: id,
113 cfg: cfg,
114 statics: newStaticsServer(cfg.GUI().Theme, assetDir),
115 model: m,
116 eventSubs: map[events.EventType]events.BufferedSubscription{
117 DefaultEventMask: defaultSub,
118 DiskEventMask: diskSub,
119 },
120 evLogger: evLogger,
121 discoverer: discoverer,
122 connectionsService: connectionsService,
123 fss: fss,
124 urService: urService,
125 guiErrors: errors,
126 systemLog: systemLog,
127 noUpgrade: noUpgrade,
128 tlsDefaultCommonName: tlsDefaultCommonName,
129 configChanged: make(chan struct{}),
130 startedOnce: make(chan struct{}),
131 exitChan: make(chan *svcutil.FatalErr, 1),
132 miscDB: miscDB,
133 shutdownTimeout: 100 * time.Millisecond,
134 }
135}
136
137func (s *service) WaitForStart() error {
138 <-s.startedOnce

Callers 4

setupGUIMethod · 0.92
TestEventMasksFunction · 0.70

Calls 2

newStaticsServerFunction · 0.85
GUIMethod · 0.65

Tested by 3

TestEventMasksFunction · 0.56