test

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestProvider

type TestProvider struct {
	mock.Mock
}

func (*TestProvider) CompleteAuth

func (p *TestProvider) 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 common.Credentials.

func (*TestProvider) DisplayName

func (p *TestProvider) DisplayName() string

DisplayName is the human readable name for this provider.

func (*TestProvider) Get

func (p *TestProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error)

func (*TestProvider) GetBeginAuthURL

func (p *TestProvider) 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.

func (*TestProvider) GetClient

func (p *TestProvider) GetClient(creds *common.Credentials) (*http.Client, error)

GetClient gets an http.Client authenticated with the specified common.Credentials.

func (*TestProvider) GetUser

func (p *TestProvider) 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 (*TestProvider) Name

func (p *TestProvider) Name() string

Name is the unique name for this provider.

func (*TestProvider) PublicData

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

type TestTripper

type TestTripper struct {
	mock.Mock
}

func (*TestTripper) Credentials

func (t *TestTripper) Credentials() *common.Credentials

func (*TestTripper) Provider

func (t *TestTripper) Provider() common.Provider

func (*TestTripper) RoundTrip

func (t *TestTripper) RoundTrip(req *http.Request) (*http.Response, error)

type TestTripperFactory

type TestTripperFactory struct {
	mock.Mock
}

func (*TestTripperFactory) NewTripper

func (t *TestTripperFactory) NewTripper(creds *common.Credentials, provider common.Provider) (common.Tripper, error)

type TestUser

type TestUser struct {
	mock.Mock
}

func (*TestUser) AuthCode

func (u *TestUser) AuthCode() string

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

func (*TestUser) AvatarURL

func (u *TestUser) AvatarURL() string

AvatarURL gets the URL of an image representing the user.

func (*TestUser) Data

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

Data gets the underlying data that makes up this User.

func (*TestUser) Email

func (u *TestUser) Email() string

Email gets the users email address.

func (*TestUser) IDForProvider

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

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

func (*TestUser) Name

func (u *TestUser) Name() string

Name gets the users full name.

func (*TestUser) Nickname

func (u *TestUser) Nickname() string

Nickname gets the users nickname or username.

func (*TestUser) ProviderCredentials

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

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

Jump to

Keyboard shortcuts

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