Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateArgs ¶
type CreateArgs struct { Name string `json:"name"` // 昵称 Email string `json:"email"` // 邮箱 Gender string `json:"gender"` // 性别 }
CreateArgs create user args
type GithubOAuth ¶
type GithubOAuth struct {
// contains filtered or unexported fields
}
GithubOAuth github oauth info
func (*GithubOAuth) AuthToken ¶
func (gitOAuth *GithubOAuth) AuthToken(ctx context.Context, state, code string) (token *oauth2.Token, err error)
AuthToken implement oauther's method
func (*GithubOAuth) AuthURL ¶
func (gitOAuth *GithubOAuth) AuthURL(state string) string
AuthURL implement oauther's method
func (*GithubOAuth) AuthUserInfo ¶
func (gitOAuth *GithubOAuth) AuthUserInfo(xl *log.Logger, token *oauth2.Token) (user models.User, err error)
AuthUserInfo implement oauther's method
type GithubUserInfo ¶
type GithubUserInfo struct { Login string `json:"login"` ID int `json:"id"` NodeID string `json:"node_id"` AvatarURL string `json:"avatar_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HTMLURL string `json:"html_url"` FollowersURL string `json:"followers_url"` FollowingURL string `json:"following_url"` GistsURL string `json:"gists_url"` StarredURL string `json:"starred_url"` SubscriptionsURL string `json:"subscriptions_url"` OrganizationsURL string `json:"organizations_url"` ReposURL string `json:"repos_url"` EventsURL string `json:"events_url"` ReceivedEventsURL string `json:"received_events_url"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` Name string `json:"name"` Company interface{} `json:"company"` Blog string `json:"blog"` Location interface{} `json:"location"` Email string `json:"email"` Hireable bool `json:"hireable"` Bio string `json:"bio"` PublicRepos int `json:"public_repos"` PublicGists int `json:"public_gists"` Followers int `json:"followers"` Following int `json:"following"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
GithubUserInfo github user info
type GoogleOAuth ¶
type GoogleOAuth struct {
// contains filtered or unexported fields
}
GoogleOAuth github oauth info
func (*GoogleOAuth) AuthToken ¶
func (googleOAuth *GoogleOAuth) AuthToken(ctx context.Context, state, code string) (token *oauth2.Token, err error)
AuthToken implement oauther's method
func (*GoogleOAuth) AuthURL ¶
func (googleOAuth *GoogleOAuth) AuthURL(state string) string
AuthURL implement oauther's method
func (*GoogleOAuth) AuthUserInfo ¶
func (googleOAuth *GoogleOAuth) AuthUserInfo(xl *log.Logger, token *oauth2.Token) (user models.User, err error)
AuthUserInfo implement oauther's method
type GoogleUserInfo ¶
type GoogleUserInfo struct { ID string `json:"id"` Email string `json:"email"` VerifiedEmail bool `json:"verified_email"` Name string `json:"name"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` Link string `json:"link"` Picture string `json:"picture"` Gender string `json:"gender"` Locale string `json:"locale"` }
GoogleUserInfo github user info
type OAuthProviderConfig ¶
type OAuthProviderConfig struct { ClientID string `mapstructure:"client_id"` ClientSecret string `mapstructure:"client_secret"` AuthURL string `mapstructure:"auth_url"` TokenURL string `mapstructure:"token_url"` Scopes []string `mapstructure:"scopes"` }
OAuthProviderConfig oauth config info
func (OAuthProviderConfig) ToOAuthConfig ¶
func (oauth OAuthProviderConfig) ToOAuthConfig(redirect string) oauth2.Config
ToOAuthConfig convert provider config to oauth config
Click to show internal directories.
Click to hide internal directories.