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

Method GetWorkspaceAgentPortShares

codersdk/workspaceagentportshare.go:110–122  ·  view source on GitHub ↗
(ctx context.Context, workspaceID uuid.UUID)

Source from the content-addressed store, hash-verified

108}
109
110func (c *Client) GetWorkspaceAgentPortShares(ctx context.Context, workspaceID uuid.UUID) (WorkspaceAgentPortShares, error) {
111 var shares WorkspaceAgentPortShares
112 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/workspaces/%s/port-share", workspaceID), nil)
113 if err != nil {
114 return shares, err
115 }
116 defer res.Body.Close()
117 if res.StatusCode != http.StatusOK {
118 return shares, ReadBodyAsError(res)
119 }
120
121 return shares, json.NewDecoder(res.Body).Decode(&shares)
122}
123
124func (c *Client) UpsertWorkspaceAgentPortShare(ctx context.Context, workspaceID uuid.UUID, req UpsertWorkspaceAgentPortShareRequest) (WorkspaceAgentPortShare, error) {
125 var share WorkspaceAgentPortShare

Callers 3

TestTemplatesFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 3

TestTemplatesFunction · 0.64