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

Method ServeMultiAgentClient

enterprise/tailnet/workspaceproxy.go:28–47  ·  view source on GitHub ↗
(ctx context.Context, version string, conn net.Conn, id uuid.UUID)

Source from the content-addressed store, hash-verified

26}
27
28func (s *ClientService) ServeMultiAgentClient(ctx context.Context, version string, conn net.Conn, id uuid.UUID) error {
29 major, _, err := apiversion.Parse(version)
30 if err != nil {
31 s.Logger.Warn(ctx, "serve client called with unparsable version", slog.Error(err))
32 return err
33 }
34 switch major {
35 case 2:
36 auth := agpl.SingleTailnetCoordinateeAuth{}
37 streamID := agpl.StreamID{
38 Name: id.String(),
39 ID: id,
40 Auth: auth,
41 }
42 return s.ServeConnV2(ctx, conn, streamID)
43 default:
44 s.Logger.Warn(ctx, "serve client called with unsupported version", slog.F("version", version))
45 return agpl.ErrUnsupportedVersion
46 }
47}

Callers 1

Calls 4

ServeConnV2Method · 0.95
ParseFunction · 0.92
ErrorMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected