Documentation ¶
Index ¶
Constants ¶
View Source
const ( //FacebookProvider is const for 'facebook' FacebookProvider = "facebook" //GoogleProvider is const for 'google' GoogleProvider = "google" )
Variables ¶
This section is empty.
Functions ¶
func IsProviderEnabled ¶
IsProviderEnabled returns true if provider is enabled
Types ¶
type HTTPService ¶
type HTTPService struct{}
HTTPService implements real OAuth operations using Golang's oauth2 package
func (*HTTPService) GetAuthURL ¶
func (p *HTTPService) GetAuthURL(authEndpoint string, provider string, redirect string) string
GetAuthURL returns authentication url for given provider
func (*HTTPService) GetProfile ¶
func (p *HTTPService) GetProfile(authEndpoint string, provider string, code string) (*UserProfile, error)
GetProfile returns user profile based on provider and code
type MockOAuthService ¶
type MockOAuthService struct{}
MockOAuthService implements a mocked OAuthService
func (*MockOAuthService) GetAuthURL ¶
func (p *MockOAuthService) GetAuthURL(authEndpoint string, provider string, redirect string) string
GetAuthURL returns authentication url for given provider
func (*MockOAuthService) GetProfile ¶
func (p *MockOAuthService) GetProfile(authEndpoint string, provider string, code string) (*UserProfile, error)
GetProfile returns user profile based on provider and code
type Service ¶
type Service interface { GetAuthURL(authEndpoint string, provider string, redirect string) string GetProfile(authEndpoint string, provider string, code string) (*UserProfile, error) }
Service provides OAuth operations
type UserProfile ¶
UserProfile represents an OAuth user profile
Click to show internal directories.
Click to hide internal directories.