Documentation
¶
Index ¶
Constants ¶
const Interval = 5 * time.Second
Interval is how long the CLI waits between two polls.
const Length = 8
Length is the number of characters of a user code: 20^8, about 2.6e10 codes.
const Lifetime = 10 * time.Minute
Lifetime is how long the user has to allow the CLI on the web app.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Input ¶
type Input struct {
// Name names the token the login gives, in the account's settings: "CLI – <hostname>".
Name string `json:"name"`
}
type Result ¶
type Result struct {
DeviceCode string `json:"device_code"`
// UserCode is shown as XXXX-XXXX; the web app may send it in any case, with or without the dash.
UserCode string `json:"user_code"`
// VerificationURI is the web app's page where the user types the code; relative ("/device") when the server
// has no --origin: the CLI joins it to its server's address.
VerificationURI string `json:"verification_uri"`
// VerificationURIComplete has the code in it already.
VerificationURIComplete string `json:"verification_uri_complete"`
// ExpiresIn is in seconds.
ExpiresIn int `json:"expires_in"`
// Interval is the seconds to wait between two polls.
Interval int `json:"interval"`
}
Result is what the CLI shows (the user code and where to type it) and keeps (the device code, to poll with).