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

Method PostLogSource

codersdk/agentsdk/agentsdk.go:683–694  ·  view source on GitHub ↗
(ctx context.Context, req PostLogSourceRequest)

Source from the content-addressed store, hash-verified

681}
682
683func (c *Client) PostLogSource(ctx context.Context, req PostLogSourceRequest) (codersdk.WorkspaceAgentLogSource, error) {
684 res, err := c.SDK.Request(ctx, http.MethodPost, "/api/v2/workspaceagents/me/log-source", req)
685 if err != nil {
686 return codersdk.WorkspaceAgentLogSource{}, err
687 }
688 defer res.Body.Close()
689 if res.StatusCode != http.StatusCreated {
690 return codersdk.WorkspaceAgentLogSource{}, codersdk.ReadBodyAsError(res)
691 }
692 var logSource codersdk.WorkspaceAgentLogSource
693 return logSource, json.NewDecoder(res.Body).Decode(&logSource)
694}
695
696type ExternalAuthResponse struct {
697 AccessToken string `json:"access_token"`

Callers 1

Calls 3

ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 1