Documentation ¶
Index ¶
- type Client
- func (c *Client) DialWorkspaceAgent(ctx context.Context, agentID uuid.UUID, ...) (agentConn *codersdk.WorkspaceAgentConn, err error)
- func (c *Client) IssueSignedAppToken(ctx context.Context, req workspaceapps.IssueTokenRequest) (IssueSignedAppTokenResponse, error)
- func (c *Client) IssueSignedAppTokenHTML(ctx context.Context, rw http.ResponseWriter, ...) (IssueSignedAppTokenResponse, bool)
- func (c *Client) RegisterWorkspaceProxy(ctx context.Context, req RegisterWorkspaceProxyRequest) (RegisterWorkspaceProxyResponse, error)
- func (c *Client) Request(ctx context.Context, method, path string, body interface{}, ...) (*http.Response, error)
- func (c *Client) RequestIgnoreRedirects(ctx context.Context, method, path string, body interface{}, ...) (*http.Response, error)
- func (c *Client) SessionToken() string
- func (c *Client) SetSessionToken(token string) error
- type IssueSignedAppTokenResponse
- type RegisterWorkspaceProxyRequest
- type RegisterWorkspaceProxyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a HTTP client for a subset of Coder API routes that external proxies need.
func (*Client) DialWorkspaceAgent ¶
func (c *Client) DialWorkspaceAgent(ctx context.Context, agentID uuid.UUID, options *codersdk.DialWorkspaceAgentOptions) (agentConn *codersdk.WorkspaceAgentConn, err error)
DialWorkspaceAgent calls the underlying codersdk.Client's DialWorkspaceAgent method.
func (*Client) IssueSignedAppToken ¶
func (c *Client) IssueSignedAppToken(ctx context.Context, req workspaceapps.IssueTokenRequest) (IssueSignedAppTokenResponse, error)
IssueSignedAppToken issues a new signed app token for the provided app request. The error page will be returned as JSON. For use in external proxies, use IssueSignedAppTokenHTML instead.
func (*Client) IssueSignedAppTokenHTML ¶
func (c *Client) IssueSignedAppTokenHTML(ctx context.Context, rw http.ResponseWriter, req workspaceapps.IssueTokenRequest) (IssueSignedAppTokenResponse, bool)
IssueSignedAppTokenHTML issues a new signed app token for the provided app request. The error page will be returned as HTML in most cases, and will be written directly to the provided http.ResponseWriter.
func (*Client) RegisterWorkspaceProxy ¶
func (c *Client) RegisterWorkspaceProxy(ctx context.Context, req RegisterWorkspaceProxyRequest) (RegisterWorkspaceProxyResponse, error)
func (*Client) Request ¶
func (c *Client) Request(ctx context.Context, method, path string, body interface{}, opts ...codersdk.RequestOption) (*http.Response, error)
Request wraps the underlying codersdk.Client's Request method.
func (*Client) RequestIgnoreRedirects ¶
func (c *Client) RequestIgnoreRedirects(ctx context.Context, method, path string, body interface{}, opts ...codersdk.RequestOption) (*http.Response, error)
RequestIgnoreRedirects wraps the underlying codersdk.Client's Request method on the client that ignores redirects.
func (*Client) SessionToken ¶
SessionToken returns the currently set token for the client.
func (*Client) SetSessionToken ¶
SetSessionToken sets the session token for the client. An error is returned if the session token is not in the correct format for external proxies.
type IssueSignedAppTokenResponse ¶
type IssueSignedAppTokenResponse struct { // SignedTokenStr should be set as a cookie on the response. SignedTokenStr string `json:"signed_token_str"` }
type RegisterWorkspaceProxyResponse ¶
type RegisterWorkspaceProxyResponse struct {
AppSecurityKey string `json:"app_security_key"`
}