reddit

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 9 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 {
	// contains filtered or unexported fields
}

func New

func New(clientID string, clientSecret string, redirectURI string, duration string, tokenEndpoint string, userURL string, scopes ...string) Provider

func (*Provider) BeginAuth

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

func (*Provider) Debug

func (p *Provider) Debug(b bool)

func (*Provider) FetchUser

func (p *Provider) FetchUser(s 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    `json:"access_token"`
	TokenType    string    `json:"token_type,omitempty"`
	RefreshToken string    `json:"refresh_token,omitempty"`
	Expiry       time.Time `json:"expiry,omitempty"`
}

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

Jump to

Keyboard shortcuts

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