Documentation ¶
Overview ¶
http oauth2 define.
Index ¶
Constants ¶
View Source
const ( Oauth2Eudore = "eudore" Oauth2Github = "github" Oauth2Google = "google" Oauth2Gitlab = "gitlab" )
Variables ¶
View Source
var ( // ErrOauthCode code exchange failed error ErrOauthCode = errors.New("Code exchange failed") // ErrUnknownOauth2 unknown oauth2 error ErrUnknownOauth2 = errors.New("unknow oauth2") )
Functions ¶
Types ¶
type Oauth2 ¶
type Oauth2 interface { // Set Ouath2 config Config(*oauth2.Config) // Get redirect Addr Redirect(string) string // Handle callback request Callback(*http.Request) (map[string]interface{}, string, error) }
Oauth2 定义http Oauth2接口
type Oauth2GithubHandle ¶
type Oauth2GithubHandle struct {
// contains filtered or unexported fields
}
func (*Oauth2GithubHandle) Config ¶
func (o *Oauth2GithubHandle) Config(config *oauth2.Config)
func (*Oauth2GithubHandle) Redirect ¶
func (o *Oauth2GithubHandle) Redirect(stats string) string
type Oauth2GitlabHandle ¶
type Oauth2GitlabHandle struct {
// contains filtered or unexported fields
}
func (*Oauth2GitlabHandle) Config ¶
func (o *Oauth2GitlabHandle) Config(config *oauth2.Config)
func (*Oauth2GitlabHandle) Redirect ¶
func (o *Oauth2GitlabHandle) Redirect(stats string) string
type Oauth2GoogleHandle ¶
type Oauth2GoogleHandle struct {
// contains filtered or unexported fields
}
func (*Oauth2GoogleHandle) Config ¶
func (o *Oauth2GoogleHandle) Config(config *oauth2.Config)
func (*Oauth2GoogleHandle) Redirect ¶
func (o *Oauth2GoogleHandle) Redirect(stats string) string
Click to show internal directories.
Click to hide internal directories.