twitter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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