Documentation ¶
Index ¶
- type UberProvider
- func (provider *UberProvider) CompleteAuth(data objx.Map) (*common.Credentials, error)
- func (provider *UberProvider) DisplayName() string
- func (provider *UberProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error)
- func (provider *UberProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error)
- func (provider *UberProvider) GetClient(creds *common.Credentials) (*http.Client, error)
- func (provider *UberProvider) GetUser(creds *common.Credentials) (common.User, error)
- func (provider *UberProvider) Name() string
- func (provider *UberProvider) PublicData(options map[string]interface{}) (interface{}, error)
- func (provider *UberProvider) TripperFactory() common.TripperFactory
- type User
- func (u *User) AuthCode() string
- func (u *User) AvatarURL() string
- func (u *User) Data() objx.Map
- func (u *User) Email() string
- func (u *User) IDForProvider(provider string) string
- func (u *User) Name() string
- func (u *User) Nickname() string
- func (u *User) ProviderCredentials() map[string]*common.Credentials
- func (u *User) PublicData(options map[string]interface{}) (publicData interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UberProvider ¶
type UberProvider struct {
// contains filtered or unexported fields
}
UberProvider implements the Provider interface and provides Uber OAuth2 communication capabilities.
func New ¶
func New(clientId, clientSecret, redirectUrl string) *UberProvider
func (*UberProvider) CompleteAuth ¶
func (provider *UberProvider) CompleteAuth(data objx.Map) (*common.Credentials, error)
CompleteAuth takes a map of arguments that are used to complete the authorisation process, completes it, and returns the appropriate Credentials.
func (*UberProvider) DisplayName ¶
func (provider *UberProvider) DisplayName() string
DisplayName is the human readable name for this provider.
func (*UberProvider) Get ¶
func (provider *UberProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error)
Get makes an authenticated request and returns the data in the response as a data map.
func (*UberProvider) GetBeginAuthURL ¶
func (provider *UberProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error)
GetBeginAuthURL gets the URL that the client must visit in order to begin the authentication process.
The state argument contains anything you wish to have sent back to your callback endpoint. The options argument takes any options used to configure the auth request sent to the provider. In the case of OAuth2, the options map can contain:
- A "scope" key providing the desired scope(s). It will be merged with the default scope.
func (*UberProvider) GetClient ¶
func (provider *UberProvider) GetClient(creds *common.Credentials) (*http.Client, error)
GetClient returns an authenticated http.Client that can be used to make requests to protected uber resources
func (*UberProvider) GetUser ¶
func (provider *UberProvider) GetUser(creds *common.Credentials) (common.User, error)
GetUser uses the specified common.Credentials to access the users profile from the remote provider, and builds the appropriate User object.
func (*UberProvider) Name ¶
func (provider *UberProvider) Name() string
Name is the unique name for this provider.
func (*UberProvider) PublicData ¶
func (provider *UberProvider) PublicData(options map[string]interface{}) (interface{}, error)
PublicData gets a public readable view of this provider.
func (*UberProvider) TripperFactory ¶
func (provider *UberProvider) TripperFactory() common.TripperFactory
TripperFactory gets an OAuth2TripperFactory
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) AuthCode ¶
AuthCode gets this user's globally unique ID (generated by the host program)
func (*User) IDForProvider ¶
IDForProvider gets the ID value for the specified provider name for this user from the ProviderCredentials data.
func (*User) ProviderCredentials ¶
func (u *User) ProviderCredentials() map[string]*common.Credentials
ProviderCredentials gets a map of Credentials (by provider name).