googleauth

package
v0.0.0-...-20679a4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleAuth

type GoogleAuth struct {
	// contains filtered or unexported fields
}

GoogleAuth is the authorization workflow implementation for google oauth api.

func New

func New(cred []byte) (*GoogleAuth, error)

New creates a new instance of google auth struct.

func (*GoogleAuth) Exchange

func (ga *GoogleAuth) Exchange(code string) (*auth.Token, error)

Exchange converts the authorization code to access token.

func (*GoogleAuth) GetURL

func (ga *GoogleAuth) GetURL(redirect, state string) string

GetURL build the authorization workflow url for google oauth api.

func (*GoogleAuth) Refresh

func (ga *GoogleAuth) Refresh(refreshToken string) (*auth.Token, error)

Refresh renews access token using refresh token.

func (*GoogleAuth) Revoke

func (ga *GoogleAuth) Revoke(token string) error

Revoke cancels the access/refresh token and resets the authorization workflow.

Jump to

Keyboard shortcuts

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