MCPcopy Index your code
hub / github.com/coder/coder / newMapper

Function newMapper

enterprise/tailnet/pgcoord.go:727–742  ·  view source on GitHub ↗
(c *connIO, logger slog.Logger, h *heartbeats)

Source from the content-addressed store, hash-verified

725}
726
727func newMapper(c *connIO, logger slog.Logger, h *heartbeats) *mapper {
728 logger = logger.With(
729 slog.F("peer_id", c.UniqueID()),
730 )
731 m := &mapper{
732 ctx: c.peerCtx, // mapper has same lifetime as the underlying connection it serves
733 logger: logger,
734 c: c,
735 update: make(chan struct{}),
736 mappings: make(chan []mapping),
737 heartbeats: h,
738 sent: make(map[uuid.UUID]mapping),
739 }
740 go m.run()
741 return m
742}
743
744func (m *mapper) run() {
745 for {

Callers 1

newConnMethod · 0.85

Calls 2

runMethod · 0.95
UniqueIDMethod · 0.80

Tested by

no test coverage detected