oauth

package
v0.0.0-...-ac733a0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OauthServiceGithub = "github"
)

Variables

View Source
var (
	GithubOAuth *oauth2.Config
)

Functions

func InitOauth

func InitOauth(appId, appSecret string)

Types

type OauthUserService

type OauthUserService interface {
	CurrentUserInfo() (map[string]interface{}, error)
	ExtractUser() (*user.User, error)
}

type UserOauthToken

type UserOauthToken struct {
	User    *user.User
	Service string
	Token   *oauth2.Token
}

func UnmarshalTokens

func UnmarshalTokens(rows *sql.Rows) ([]*UserOauthToken, error)

func UserOauthTokens

func UserOauthTokens(db sqlutil.Queryable, u *user.User) ([]*UserOauthToken, error)

func (*UserOauthToken) Delete

func (g *UserOauthToken) Delete(db *sql.DB) error

func (*UserOauthToken) Read

func (t *UserOauthToken) Read(db sqlutil.Queryable) error

func (*UserOauthToken) ReadUser

func (t *UserOauthToken) ReadUser(db sqlutil.Queryable) (*user.User, error)

func (*UserOauthToken) SQLArgs

func (t *UserOauthToken) SQLArgs() []interface{}

func (*UserOauthToken) Save

func (t *UserOauthToken) Save(db sqlutil.Execable) error

func (*UserOauthToken) UnmarshalSQL

func (g *UserOauthToken) UnmarshalSQL(row sqlutil.Scannable) error

turn a sql.Row result into a reset token pointer

Jump to

Keyboard shortcuts

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