Documentation
¶
Index ¶
- Constants
- Variables
- func CacheTokens(cacheStore *UserStore) error
- func Command() *cli.Command
- func GetCachedAccessToken() (string, error)
- func GetJSON(url, token string, value interface{}) error
- func GithubPrimaryEmail(accessToken string) (string, error)
- func GithubUser(accessToken string) (*githubUser, error)
- type HttpError
- type UserStore
Constants ¶
View Source
const ( Settings = "settings:pippy" Scope = "repo workflow user:email read:org read:user" GrantType = "urn:ietf:params:oauth:grant-type:device_code" )
Variables ¶
View Source
var ( NameCtx = &contextKey{"UserName"} EmailCtx = &contextKey{"UserEmail"} )
View Source
var ClientID string = "46ca5443da5014f4f00f"
Functions ¶
func CacheTokens ¶
func GetCachedAccessToken ¶
func GithubPrimaryEmail ¶
func GithubUser ¶
Types ¶
type UserStore ¶
type UserStore struct {
AccessToken string `json:"access_token"`
ExpiresIn int64 `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
RefreshTokenExpiresIn int64 `json:"refresh_token_expires_in"`
RefreshTime int64 `json:"refresh_time"`
GithubUser githubUser `json:"user"`
}
userStore caches accesstoken and apikey in ~/.pippy/db
func GetCachedTokens ¶
func LoginUser ¶
LoginUser logs user into pippy and generates api key for usage Apikey is typically valid for predetermined time, key is automatically refreshed by client if signup is true, signs up user automatically
func RefreshAccessToken ¶
Click to show internal directories.
Click to hide internal directories.