Documentation
¶
Overview ¶
Package api contains HTTP clients for the GSD Cloud web app.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin wrapper around net/http for the web app API.
func NewClient ¶
NewClient creates a Client pointed at a base URL (e.g. https://app.gsd.build).
func (*Client) Pair ¶
func (c *Client) Pair(req PairRequest) (*PairResponse, error)
Pair calls POST /api/daemon/pair.
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(req RefreshTokenRequest) (*RefreshTokenResponse, error)
RefreshToken calls POST /api/daemon/refresh-token.
type PairRequest ¶
type PairRequest struct {
Code string `json:"code"`
Hostname string `json:"hostname"`
OS string `json:"os"`
Arch string `json:"arch"`
DaemonVersion string `json:"daemonVersion"`
InstallationID string `json:"installationId,omitempty"`
CurrentMachineID string `json:"currentMachineId,omitempty"`
}
PairRequest is the body of POST /api/daemon/pair.
type PairResponse ¶
type PairResponse struct {
MachineID string `json:"machineId"`
AuthToken string `json:"authToken"`
TokenExpiresAt string `json:"tokenExpiresAt"`
RelayURL string `json:"relayUrl"`
}
PairResponse is the successful response from the pairing endpoint.
type RefreshTokenRequest ¶
RefreshTokenRequest is the body of POST /api/daemon/refresh-token.
type RefreshTokenResponse ¶
type RefreshTokenResponse struct {
AuthToken string `json:"authToken"`
TokenExpiresAt string `json:"tokenExpiresAt"`
}
RefreshTokenResponse is the successful response from the refresh-token endpoint.
Click to show internal directories.
Click to hide internal directories.