social

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2015 License: Apache-2.0 Imports: 8 Imported by: ? 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 (
	SocialBaseUrl = "/login/"
	SocialMap     = make(map[string]SocialConnector)
)

Functions

func NewOAuthService

func NewOAuthService()

Types

type BasicUserInfo

type BasicUserInfo struct {
	Identity string
	Name     string
	Email    string
	Login    string
	Company  string
}

type SocialConnector

type SocialConnector interface {
	Type() int
	UserInfo(token *oauth2.Token) (*BasicUserInfo, error)
	IsEmailAllowed(email string) bool
	IsSignupAllowed() bool

	AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
	Exchange(ctx context.Context, code string) (*oauth2.Token, error)
}

type SocialGithub

type SocialGithub struct {
	*oauth2.Config

	ApiUrl string
	// contains filtered or unexported fields
}

func (*SocialGithub) IsEmailAllowed

func (s *SocialGithub) IsEmailAllowed(email string) bool

func (*SocialGithub) IsSignupAllowed

func (s *SocialGithub) IsSignupAllowed() bool

func (*SocialGithub) Type

func (s *SocialGithub) Type() int

func (*SocialGithub) UserInfo

func (s *SocialGithub) UserInfo(token *oauth2.Token) (*BasicUserInfo, error)

type SocialGoogle

type SocialGoogle struct {
	*oauth2.Config

	ApiUrl string
	// contains filtered or unexported fields
}

func (*SocialGoogle) IsEmailAllowed

func (s *SocialGoogle) IsEmailAllowed(email string) bool

func (*SocialGoogle) IsSignupAllowed

func (s *SocialGoogle) IsSignupAllowed() bool

func (*SocialGoogle) Type

func (s *SocialGoogle) Type() int

func (*SocialGoogle) UserInfo

func (s *SocialGoogle) UserInfo(token *oauth2.Token) (*BasicUserInfo, error)

Jump to

Keyboard shortcuts

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