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

Method DeleteWorkspaceProxyByName

codersdk/workspaceproxy.go:135–150  ·  view source on GitHub ↗
(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

133}
134
135func (c *Client) DeleteWorkspaceProxyByName(ctx context.Context, name string) error {
136 res, err := c.Request(ctx, http.MethodDelete,
137 fmt.Sprintf("/api/v2/workspaceproxies/%s", name),
138 nil,
139 )
140 if err != nil {
141 return xerrors.Errorf("make request: %w", err)
142 }
143 defer res.Body.Close()
144
145 if res.StatusCode != http.StatusOK {
146 return ReadBodyAsError(res)
147 }
148
149 return nil
150}
151
152func (c *Client) DeleteWorkspaceProxyByID(ctx context.Context, id uuid.UUID) error {
153 return c.DeleteWorkspaceProxyByName(ctx, id.String())

Callers 3

setupWorkspaceProxyFunction · 0.80
deleteProxyMethod · 0.80

Calls 4

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

Tested by

no test coverage detected