wsproxysdk

package
v0.27.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentIsLegacyResponse added in v0.26.2

type AgentIsLegacyResponse struct {
	Found  bool `json:"found"`
	Legacy bool `json:"legacy"`
}

type Client

type Client struct {
	SDKClient *codersdk.Client
	// contains filtered or unexported fields
}

Client is a HTTP client for a subset of Coder API routes that external proxies need.

func New

func New(serverURL *url.URL) *Client

New creates a external proxy client for the provided primary coder server URL.

func (*Client) AgentIsLegacy added in v0.26.2

func (c *Client) AgentIsLegacy(ctx context.Context, agentID uuid.UUID) (AgentIsLegacyResponse, error)

func (*Client) DialCoordinator added in v0.26.2

func (c *Client) DialCoordinator(ctx context.Context) (agpl.MultiAgentConn, error)

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

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

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) 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

func (c *Client) SessionToken() string

SessionToken returns the currently set token for the client.

func (*Client) SetSessionToken

func (c *Client) SetSessionToken(token string) error

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.

func (*Client) WorkspaceProxyGoingAway added in v0.23.3

func (c *Client) WorkspaceProxyGoingAway(ctx context.Context) error

type CoordinateMessage added in v0.26.2

type CoordinateMessage struct {
	Type    CoordinateMessageType `json:"type"`
	AgentID uuid.UUID             `json:"agent_id"`
	Node    *agpl.Node            `json:"node"`
}

type CoordinateMessageType added in v0.26.2

type CoordinateMessageType int
const (
	CoordinateMessageTypeSubscribe CoordinateMessageType = 1 + iota
	CoordinateMessageTypeUnsubscribe
	CoordinateMessageTypeNodeUpdate
)

type CoordinateNodes added in v0.26.2

type CoordinateNodes struct {
	Nodes []*agpl.Node
}

type IssueSignedAppTokenResponse

type IssueSignedAppTokenResponse struct {
	// SignedTokenStr should be set as a cookie on the response.
	SignedTokenStr string `json:"signed_token_str"`
}

type RegisterWorkspaceProxyRequest

type RegisterWorkspaceProxyRequest struct {
	// AccessURL that hits the workspace proxy api.
	AccessURL string `json:"access_url"`
	// WildcardHostname that the workspace proxy api is serving for subdomain apps.
	WildcardHostname string `json:"wildcard_hostname"`
}

type RegisterWorkspaceProxyResponse

type RegisterWorkspaceProxyResponse struct {
	AppSecurityKey string `json:"app_security_key"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL