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

Method WorkspaceProxies

codersdk/workspaceproxy.go:92–108  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

90}
91
92func (c *Client) WorkspaceProxies(ctx context.Context) (RegionsResponse[WorkspaceProxy], error) {
93 res, err := c.Request(ctx, http.MethodGet,
94 "/api/v2/workspaceproxies",
95 nil,
96 )
97 if err != nil {
98 return RegionsResponse[WorkspaceProxy]{}, xerrors.Errorf("make request: %w", err)
99 }
100 defer res.Body.Close()
101
102 if res.StatusCode != http.StatusOK {
103 return RegionsResponse[WorkspaceProxy]{}, ReadBodyAsError(res)
104 }
105
106 var proxies RegionsResponse[WorkspaceProxy]
107 return proxies, json.NewDecoder(res.Body).Decode(&proxies)
108}
109
110type PatchWorkspaceProxy struct {
111 ID uuid.UUID `json:"id" format:"uuid" validate:"required"`

Callers 4

TestRegionsFunction · 0.80
TestWorkspaceProxyCRUDFunction · 0.80
Test_ProxyCRUDFunction · 0.80
listProxiesMethod · 0.80

Calls 4

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
ErrorfMethod · 0.45

Tested by 3

TestRegionsFunction · 0.64
TestWorkspaceProxyCRUDFunction · 0.64
Test_ProxyCRUDFunction · 0.64