ConnectRPCWithRole connects to the workspace agent RPC API with an explicit role. The role parameter is sent to the server to identify the type of client. Use "agent" for workspace agents to enable connection monitoring.
(ctx context.Context, role string)
| 350 | // the type of client. Use "agent" for workspace agents to enable |
| 351 | // connection monitoring. |
| 352 | func (c *Client) ConnectRPCWithRole(ctx context.Context, role string) (drpc.Conn, error) { |
| 353 | return c.connectRPCVersion(ctx, proto.CurrentVersion, role) |
| 354 | } |
| 355 | |
| 356 | func (c *Client) connectRPCVersion(ctx context.Context, version *apiversion.APIVersion, role string) (drpc.Conn, error) { |
| 357 | rpcURL, err := c.SDK.URL.Parse("/api/v2/workspaceagents/me/rpc") |