MCPcopy
hub / github.com/syncthing/syncthing / Index

Method Index

lib/protocol/protocol.go:318–330  ·  view source on GitHub ↗

Index writes the list of file information to the connected peer device

(ctx context.Context, idx *Index)

Source from the content-addressed store, hash-verified

316
317// Index writes the list of file information to the connected peer device
318func (c *rawConnection) Index(ctx context.Context, idx *Index) error {
319 select {
320 case <-c.closed:
321 return ErrClosed
322 case <-ctx.Done():
323 return ctx.Err()
324 default:
325 }
326 c.idxMut.Lock()
327 c.send(ctx, idx.toWire(), nil)
328 c.idxMut.Unlock()
329 return nil
330}
331
332// IndexUpdate writes the list of file information to the connected peer device as an update
333func (c *rawConnection) IndexUpdate(ctx context.Context, idxUp *IndexUpdate) error {

Callers

nothing calls this directly

Calls 4

sendMethod · 0.95
DoneMethod · 0.80
UnlockMethod · 0.80
toWireMethod · 0.45

Tested by

no test coverage detected