instagram

package
v0.0.0-...-4b6c822 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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:

  1. 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 NewUser

func NewUser(data objx.Map, creds *common.Credentials, provider common.Provider) *User

NewUser builds a new User object for Instagram.

func (*User) AuthCode

func (u *User) AuthCode() string

AuthCode gets this user's globally unique ID (generated by the host program)

func (*User) AvatarURL

func (u *User) AvatarURL() string

AvatarURL gets the URL of an image representing the user.

func (*User) Data

func (u *User) Data() objx.Map

GetValue gets any User field by name.

func (*User) Email

func (u *User) Email() string

Instagram API doesn't return email

func (*User) IDForProvider

func (u *User) IDForProvider(provider string) string

IDForProvider gets the ID value for the specified provider name for this user from the ProviderCredentials data.

func (*User) Name

func (u *User) Name() string

Name gets the users full name.

func (*User) Nickname

func (u *User) Nickname() string

Nickname gets the users nickname or username.

func (*User) ProviderCredentials

func (u *User) ProviderCredentials() map[string]*common.Credentials

ProviderCredentials gets a map of Credentials (by provider name).

func (*User) PublicData

func (u *User) PublicData(options map[string]interface{}) (publicData interface{}, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL