MCPcopy Create free account
hub / github.com/coder/coder / retrieve

Method retrieve

enterprise/tailnet/pgcoord.go:396–416  ·  view source on GitHub ↗

retrieveBinding gets the latest tunnel for a key.

(k tKey)

Source from the content-addressed store, hash-verified

394
395// retrieveBinding gets the latest tunnel for a key.
396func (t *tunneler) retrieve(k tKey) tunnel {
397 t.mu.Lock()
398 defer t.mu.Unlock()
399 dstMap, ok := t.latest[k.src]
400 if !ok {
401 return tunnel{
402 tKey: k,
403 active: false,
404 }
405 }
406
407 tun, ok := dstMap[k.dst]
408 if !ok {
409 return tunnel{
410 tKey: k,
411 active: false,
412 }
413 }
414
415 return tun
416}
417
418func (t *tunneler) writeOne(tun tunnel) error {
419 var err error

Callers 1

workerMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected