classlink

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	ClientKey    string
	ClientSecret string
	CallbackURL  string
	HTTPClient   *http.Client
	// contains filtered or unexported fields
}

Provider is an implementation of

func New

func New(clientKey, secret, callbackURL string, scopes ...string) *Provider

func (Provider) BeginAuth

func (p Provider) BeginAuth(state string) (goth.Session, error)

func (Provider) Client

func (p Provider) Client() *http.Client

func (Provider) Debug

func (p Provider) Debug(b bool)

func (Provider) FetchUser

func (p Provider) FetchUser(session goth.Session) (goth.User, error)

func (Provider) Name

func (p Provider) Name() string

func (Provider) RefreshToken

func (p Provider) RefreshToken(refreshToken string) (*oauth2.Token, error)

func (Provider) RefreshTokenAvailable

func (p Provider) RefreshTokenAvailable() bool

func (Provider) SetName

func (p Provider) SetName(name string)

func (Provider) UnmarshalSession

func (p Provider) UnmarshalSession(s string) (goth.Session, error)

type Session

type Session struct {
	AuthURL      string
	AccessToken  string
	RefreshToken string
	ExpiresAt    time.Time
}

func (*Session) Authorize

func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error)

func (*Session) GetAuthURL

func (s *Session) GetAuthURL() (string, error)

func (*Session) Marshal

func (s *Session) Marshal() string

func (*Session) String

func (s *Session) String() string

Jump to

Keyboard shortcuts

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