twitter

package
v0.0.0-...-8d08159 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserInfoURL = "https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true"

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID         string
	ClientSecret     string
	AuthorizeURL     string
	TokenURL         string
	RedirectURL      string
	AuthorizeHandler func(context *auth.Context) (*claims.Claims, error)
}

Config twitter Config

type Provider

type Provider struct {
	Auth *auth.Auth
	*Config
}

Provider provide login with twitter

func New

func New(config *Config) *Provider

func (Provider) Callback

func (provider Provider) Callback(context *auth.Context)

Callback implement Callback with twitter provider

func (*Provider) ConfigAuth

func (provider *Provider) ConfigAuth(auth *auth.Auth)

ConfigAuth config auth

func (Provider) GetName

func (Provider) GetName() string

GetName return provider name

func (Provider) Login

func (provider Provider) Login(context *auth.Context)

Login implemented login with twitter provider

func (Provider) Logout

func (Provider) Logout(context *auth.Context)

Logout implemented logout with twitter provider

func (Provider) NewConsumer

func (provider Provider) NewConsumer(context *auth.Context) *oauth.Consumer

NewConsumer new twitter consumer

func (Provider) Register

func (provider Provider) Register(context *auth.Context)

Register implemented register with twitter provider

func (Provider) ServeHTTP

func (Provider) ServeHTTP(*auth.Context)

ServeHTTP implement ServeHTTP with twitter provider

type UserInfo

type UserInfo struct {
	ID       string `json:"id_str"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Location string `json:"location"`
	Locale   string `json:"lang"`
	Picture  string `json:"profile_image_url"`
	Profile  string `json:"url"`
	Verified bool   `json:"verified"`
}

UserInfo twitter user info structure

Jump to

Keyboard shortcuts

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