Documentation ¶
Index ¶
- type InstagramProvider
- func (provider *InstagramProvider) CompleteAuth(data objx.Map) (*common.Credentials, error)
- func (provider *InstagramProvider) DisplayName() string
- func (provider *InstagramProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error)
- func (provider *InstagramProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error)
- func (provider *InstagramProvider) GetClient(creds *common.Credentials) (*http.Client, error)
- func (provider *InstagramProvider) GetUser(creds *common.Credentials) (common.User, error)
- func (provider *InstagramProvider) Name() string
- func (provider *InstagramProvider) PublicData(options map[string]interface{}) (interface{}, error)
- func (provider *InstagramProvider) 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 InstagramProvider ¶
type InstagramProvider struct {
// contains filtered or unexported fields
}
InstagramProvider implements the Provider interface and provides Instagram OAuth2 communication capabilities.
func New ¶
func New(clientId, clientSecret, redirectUrl string) *InstagramProvider
func (*InstagramProvider) CompleteAuth ¶
func (provider *InstagramProvider) 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 (*InstagramProvider) DisplayName ¶
func (provider *InstagramProvider) DisplayName() string
DisplayName is the human readable name for this provider.
func (*InstagramProvider) Get ¶
func (provider *InstagramProvider) 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 (*InstagramProvider) GetBeginAuthURL ¶
func (provider *InstagramProvider) 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 (*InstagramProvider) GetClient ¶
func (provider *InstagramProvider) GetClient(creds *common.Credentials) (*http.Client, error)
GetClient returns an authenticated http.Client that can be used to make requests to protected Instagram resources
func (*InstagramProvider) GetUser ¶
func (provider *InstagramProvider) 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 (*InstagramProvider) Name ¶
func (provider *InstagramProvider) Name() string
Name is the unique name for this provider.
func (*InstagramProvider) PublicData ¶
func (provider *InstagramProvider) PublicData(options map[string]interface{}) (interface{}, error)
PublicData gets a public readable view of this provider.
func (*InstagramProvider) TripperFactory ¶
func (provider *InstagramProvider) 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).