social

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2014 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SocialBaseUrl = "/user/login"
	SocialMap     = make(map[string]SocialConnector)
)

Functions

func NewOauthService

func NewOauthService()

Types

type BasicUserInfo

type BasicUserInfo struct {
	Identity string
	Name     string
	Email    string
}

type SocialConnector

type SocialConnector interface {
	Type() int
	SetRedirectUrl(string)
	UserInfo(*oauth.Token, *url.URL) (*BasicUserInfo, error)

	AuthCodeURL(string) string
	Exchange(string) (*oauth.Token, error)
}

type SocialGithub

type SocialGithub struct {
	Token *oauth.Token
	*oauth.Transport
}

func (*SocialGithub) SetRedirectUrl

func (s *SocialGithub) SetRedirectUrl(url string)

func (*SocialGithub) Type

func (s *SocialGithub) Type() int

func (*SocialGithub) UserInfo

func (s *SocialGithub) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo, error)

type SocialGoogle

type SocialGoogle struct {
	Token *oauth.Token
	*oauth.Transport
}

func (*SocialGoogle) SetRedirectUrl

func (s *SocialGoogle) SetRedirectUrl(url string)

func (*SocialGoogle) Type

func (s *SocialGoogle) Type() int

func (*SocialGoogle) UserInfo

func (s *SocialGoogle) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo, error)

type SocialTencent

type SocialTencent struct {
	Token *oauth.Token
	*oauth.Transport
	// contains filtered or unexported fields
}

func (*SocialTencent) SetRedirectUrl

func (s *SocialTencent) SetRedirectUrl(url string)

func (*SocialTencent) Type

func (s *SocialTencent) Type() int

func (*SocialTencent) UserInfo

func (s *SocialTencent) UserInfo(token *oauth.Token, URL *url.URL) (*BasicUserInfo, error)

type SocialTwitter

type SocialTwitter struct {
	Token *oauth.Token
	*oauth.Transport
}

func (*SocialTwitter) SetRedirectUrl

func (s *SocialTwitter) SetRedirectUrl(url string)

func (*SocialTwitter) Type

func (s *SocialTwitter) Type() int

func (*SocialTwitter) UserInfo

func (s *SocialTwitter) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo, error)

https://github.com/mrjones/oauth

type SocialWeibo

type SocialWeibo struct {
	Token *oauth.Token
	*oauth.Transport
}

func (*SocialWeibo) SetRedirectUrl

func (s *SocialWeibo) SetRedirectUrl(url string)

func (*SocialWeibo) Type

func (s *SocialWeibo) Type() int

func (*SocialWeibo) UserInfo

func (s *SocialWeibo) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo, error)

Jump to

Keyboard shortcuts

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