(ctx context.Context, network, addr string)
| 263 | } |
| 264 | |
| 265 | func (s *ServerTailnet) dialContext(ctx context.Context, network, addr string) (net.Conn, error) { |
| 266 | agentID, ok := ctx.Value(agentIDKey{}).(uuid.UUID) |
| 267 | if !ok { |
| 268 | return nil, xerrors.Errorf("no agent id attached") |
| 269 | } |
| 270 | |
| 271 | nc, err := s.DialAgentNetConn(ctx, agentID, network, addr) |
| 272 | if err != nil { |
| 273 | return nil, err |
| 274 | } |
| 275 | |
| 276 | s.connsPerAgent.WithLabelValues("tcp").Inc() |
| 277 | s.totalConns.WithLabelValues("tcp").Inc() |
| 278 | return &instrumentedConn{ |
| 279 | Conn: nc, |
| 280 | agentID: agentID, |
| 281 | connsPerAgent: s.connsPerAgent, |
| 282 | }, nil |
| 283 | } |
| 284 | |
| 285 | func (s *ServerTailnet) AgentConn(ctx context.Context, agentID uuid.UUID) (workspacesdk.AgentConn, func(), error) { |
| 286 | var ( |
nothing calls this directly
no test coverage detected