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

Method AgentConnectionInfo

codersdk/workspacesdk/workspacesdk.go:164–176  ·  view source on GitHub ↗
(ctx context.Context, agentID uuid.UUID)

Source from the content-addressed store, hash-verified

162}
163
164func (c *Client) AgentConnectionInfo(ctx context.Context, agentID uuid.UUID) (AgentConnectionInfo, error) {
165 res, err := c.client.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/workspaceagents/%s/connection", agentID), nil)
166 if err != nil {
167 return AgentConnectionInfo{}, err
168 }
169 defer res.Body.Close()
170 if res.StatusCode != http.StatusOK {
171 return AgentConnectionInfo{}, codersdk.ReadBodyAsError(res)
172 }
173
174 var connInfo AgentConnectionInfo
175 return connInfo, json.NewDecoder(res.Body).Decode(&connInfo)
176}
177
178// AgentConnFunc returns a new connection to the specified agent. If release is
179// non-nil, callers must invoke it after they are done with the AgentConn.

Callers 3

DialAgentMethod · 0.95
TestAgentConnectionInfoFunction · 0.80
TestDERPFunction · 0.80

Calls 3

ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 2

TestAgentConnectionInfoFunction · 0.64
TestDERPFunction · 0.64