Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailResponse ¶
type EmailResponse struct { Email string `json:"email"` Primary bool `json:"primary"` Verified bool `json:"verified"` }
EmailResponse represents the response for an email entity
type TokenRequest ¶
type TokenRequest struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` Code string `json:"code"` }
TokenRequest represents the data that must be sent to GitHub to get a token.
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"access_token"` Scope string `json:"scope"` TokenType string `json:"token_type"` }
TokenResponse represents the response from GitHub.
type User ¶
type User struct { AccessToken string Scope string Email string Name string ID int64 Login string AvatarURL string HTMLURL string }
User organizes the data we care about for the GitHub user.
func GetUserFromCode ¶
GetUserFromCode retrieves the access token and user from GitHub https://github.com/login/oauth/authorize?client_id=&scope=user:email&state=random
Click to show internal directories.
Click to hide internal directories.