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

Method ConnectRPCWithRole

codersdk/agentsdk/agentsdk.go:352–354  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

350// the type of client. Use "agent" for workspace agents to enable
351// connection monitoring.
352func (c *Client) ConnectRPCWithRole(ctx context.Context, role string) (drpc.Conn, error) {
353 return c.connectRPCVersion(ctx, proto.CurrentVersion, role)
354}
355
356func (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")

Callers 2

createWorkspaceWithAppsFunction · 0.80

Calls 1

connectRPCVersionMethod · 0.95

Tested by 1