MCPcopy Index your code
hub / github.com/tailscale/tailscale / FetchNetMapForTest

Method FetchNetMapForTest

control/controlclient/direct.go:993–1005  ·  view source on GitHub ↗

FetchNetMapForTest fetches the netmap once.

(ctx context.Context)

Source from the content-addressed store, hash-verified

991
992// FetchNetMapForTest fetches the netmap once.
993func (c *Direct) FetchNetMapForTest(ctx context.Context) (*netmap.NetworkMap, error) {
994 var nu rememberLastNetmapUpdater
995 nu.done = make(chan any, 1)
996 err := c.sendMapRequest(ctx, false, &nu)
997 if err != nil {
998 return nil, err
999 }
1000 if nu.last == nil {
1001 return nil, errors.New("[unexpected] sendMapRequest success without callback")
1002 }
1003 <-nu.done
1004 return nu.last, err
1005}
1006
1007// SendUpdate makes a /map request to update the server of our latest state, but
1008// does not fetch anything. It returns an error if the server did not return a

Callers

nothing calls this directly

Calls 2

sendMapRequestMethod · 0.95
NewMethod · 0.45

Tested by

no test coverage detected