Documentation
¶
Index ¶
- Constants
- type AuthUser
- type Github
- func (p Github) AuthUrl() string
- func (p Github) Client(token *oauth2.Token) *http.Client
- func (p Github) ClientId() string
- func (p Github) ClientSecret() string
- func (p Github) Context() context.Context
- func (p Github) DisplayName() string
- func (p Github) FetchRawUserData(token *oauth2.Token) (data []byte, err error)
- func (p Github) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *Github) FetchUser(token *oauth2.Token) (*AuthUser, error)
- func (p Github) RedirectUrl() string
- func (p Github) Scopes() []string
- func (p Github) SetAuthUrl(authUrl string)
- func (p Github) SetClientId(clientId string)
- func (p Github) SetClientSecret(clientSecret string)
- func (p Github) SetContext(ctx context.Context)
- func (p Github) SetRedirectUrl(redirectUrl string)
- func (p Github) SetScopes(scopes []string)
- func (p Github) SetTokenUrl(tokenUrl string)
- func (p Github) SetUserApiUrl(userApiUrl string)
- func (p Github) TokenUrl() string
- func (p Github) UserApiUrl() string
- type Google
- func (p Google) AuthUrl() string
- func (p Google) Client(token *oauth2.Token) *http.Client
- func (p Google) ClientId() string
- func (p Google) ClientSecret() string
- func (p Google) Context() context.Context
- func (p Google) DisplayName() string
- func (p Google) FetchRawUserData(token *oauth2.Token) (data []byte, err error)
- func (p *Google) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *Google) FetchUser(token *oauth2.Token) (*AuthUser, error)
- func (p Google) RedirectUrl() string
- func (p Google) Scopes() []string
- func (p Google) SetAuthUrl(authUrl string)
- func (p Google) SetClientId(clientId string)
- func (p Google) SetClientSecret(clientSecret string)
- func (p Google) SetContext(ctx context.Context)
- func (p Google) SetRedirectUrl(redirectUrl string)
- func (p Google) SetScopes(scopes []string)
- func (p Google) SetTokenUrl(tokenUrl string)
- func (p Google) SetUserApiUrl(userApiUrl string)
- func (p Google) TokenUrl() string
- func (p Google) UserApiUrl() string
- type Provider
- type ProviderOption
Constants ¶
View Source
const NameGithub = "github"
View Source
const NameGoogle string = "google"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
func NewGithub ¶
func NewGithub(opts ...ProviderOption) *Github
func (Github) ClientSecret ¶
func (p Github) ClientSecret() string
func (Github) DisplayName ¶
func (p Github) DisplayName() string
func (Github) FetchRawUserData ¶
func (Github) FetchToken ¶
func (Github) RedirectUrl ¶
func (p Github) RedirectUrl() string
func (Github) SetAuthUrl ¶
func (p Github) SetAuthUrl(authUrl string)
func (Github) SetClientId ¶
func (p Github) SetClientId(clientId string)
func (Github) SetClientSecret ¶
func (p Github) SetClientSecret(clientSecret string)
func (Github) SetContext ¶
func (Github) SetRedirectUrl ¶
func (p Github) SetRedirectUrl(redirectUrl string)
func (Github) SetTokenUrl ¶
func (p Github) SetTokenUrl(tokenUrl string)
func (Github) SetUserApiUrl ¶
func (p Github) SetUserApiUrl(userApiUrl string)
func (Github) UserApiUrl ¶
func (p Github) UserApiUrl() string
type Google ¶
type Google struct {
// contains filtered or unexported fields
}
func NewGoogle ¶
func NewGoogle(opts ...ProviderOption) *Google
func (Google) ClientSecret ¶
func (p Google) ClientSecret() string
func (Google) DisplayName ¶
func (p Google) DisplayName() string
func (Google) FetchRawUserData ¶
func (*Google) FetchToken ¶
func (Google) RedirectUrl ¶
func (p Google) RedirectUrl() string
func (Google) SetAuthUrl ¶
func (p Google) SetAuthUrl(authUrl string)
func (Google) SetClientId ¶
func (p Google) SetClientId(clientId string)
func (Google) SetClientSecret ¶
func (p Google) SetClientSecret(clientSecret string)
func (Google) SetContext ¶
func (Google) SetRedirectUrl ¶
func (p Google) SetRedirectUrl(redirectUrl string)
func (Google) SetTokenUrl ¶
func (p Google) SetTokenUrl(tokenUrl string)
func (Google) SetUserApiUrl ¶
func (p Google) SetUserApiUrl(userApiUrl string)
func (Google) UserApiUrl ¶
func (p Google) UserApiUrl() string
type Provider ¶
type Provider interface { Context() context.Context SetContext(ctx context.Context) DisplayName() string Scopes() []string SetScopes(scopes []string) ClientId() string SetClientId(clientId string) ClientSecret() string SetClientSecret(clientSecret string) RedirectUrl() string SetRedirectUrl(redirectUrl string) AuthUrl() string SetAuthUrl(authUrl string) TokenUrl() string SetTokenUrl(tokenUrl string) UserApiUrl() string SetUserApiUrl(userApiUrl string) Client(token *oauth2.Token) *http.Client FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) FetchUser(token *oauth2.Token) (user *AuthUser, err error) }
type ProviderOption ¶
type ProviderOption func(Provider)
func WithClientId ¶
func WithClientId(clientId string) ProviderOption
func WithClientSecret ¶
func WithClientSecret(clientSecret string) ProviderOption
func WithRedirectUrl ¶
func WithRedirectUrl(redirectUrl string) ProviderOption
Click to show internal directories.
Click to hide internal directories.