extensions

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate added in v0.2.0

func Authenticate(
	token *oauth2.Token,
	credentials models.Credentials,
	db models.DB,
) (string, int, error)

Authenticate authenticates an access token or gets a new one with the refresh token The returned string is either the error message or the user email

func GenerateLoginURL

func GenerateLoginURL(oauthState string, credentials models.Credentials) (string, error)

GenerateLoginURL generates the login url using googleapis OAuth2 Client Secret and OAuth2 Client ID

func GetAccessToken

func GetAccessToken(code string) (*oauth2.Token, error)

GetAccessToken exchange authorization code with access token

func SaveToken added in v0.2.0

func SaveToken(token *oauth2.Token, email, keyAccessToken string, db models.DB) error

SaveToken writes the token parameters on DB

func Token added in v0.2.0

func Token(accessToken string, db models.DB) (*oauth2.Token, error)

Token reads token from DB

Types

This section is empty.

Jump to

Keyboard shortcuts

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