MCPcopy
hub / github.com/syncthing/syncthing / Model

Method Model

lib/rc/rc.go:378–392  ·  view source on GitHub ↗
(folder string)

Source from the content-addressed store, hash-verified

376}
377
378func (p *Process) Model(folder string) (Model, error) {
379 bs, err := p.Get("/rest/db/status?folder=" + url.QueryEscape(folder))
380 if err != nil {
381 return Model{}, err
382 }
383
384 var res Model
385 if err := json.Unmarshal(bs, &res); err != nil {
386 return Model{}, err
387 }
388
389 l.Debugf("%+v", res)
390
391 return res, nil
392}
393
394func (*Process) readResponse(resp *http.Response) ([]byte, error) {
395 bs, err := io.ReadAll(resp.Body)

Callers 3

TestResetFunction · 0.80
TestIgnoresFunction · 0.80

Calls 3

GetMethod · 0.95
DebugfMethod · 0.80
UnmarshalMethod · 0.45

Tested by 3

TestResetFunction · 0.64
TestIgnoresFunction · 0.64