Documentation
¶
Index ¶
- func RegisterGitHub(r *ProviderRegistry)
- type ProviderRegistry
- func (r *ProviderRegistry) Endpoint(providerID string) (oauth2.Endpoint, bool)
- func (r *ProviderRegistry) Register(providerID string, endpoint oauth2.Endpoint, fetcher UserInfoFetcher)
- func (r *ProviderRegistry) UserInfo(ctx context.Context, providerID string, token *oauth2.Token) (providerUserID, email string, err error)
- type UserInfoFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterGitHub ¶
func RegisterGitHub(r *ProviderRegistry)
Types ¶
type ProviderRegistry ¶
type ProviderRegistry struct {
// contains filtered or unexported fields
}
ProviderRegistry provides OAuth endpoint and user-info fetch for known providers.
func NewProviderRegistry ¶
func NewProviderRegistry() *ProviderRegistry
NewProviderRegistry returns a registry with built-in providers (e.g. github).
func (*ProviderRegistry) Endpoint ¶
func (r *ProviderRegistry) Endpoint(providerID string) (oauth2.Endpoint, bool)
Endpoint returns the OAuth2 endpoint for the provider, or false if unknown.
func (*ProviderRegistry) Register ¶
func (r *ProviderRegistry) Register(providerID string, endpoint oauth2.Endpoint, fetcher UserInfoFetcher)
Register adds a provider's endpoint and user-info fetcher.
Click to show internal directories.
Click to hide internal directories.