auth

package
v0.0.0-...-e9ca3b0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsentHandlerFunc

type ConsentHandlerFunc func(authURL string) (string, error)

ConsentHandlerFunc describes a handler callback for exchanging auth. code against access token

type GToken

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

GToken is a wrapper for retrieving and caching google access token

func NewGToken

func NewGToken(credentialsFile, cacheFile, cacheDir string) GToken

NewGToken lazy inits a GToken struct

func (*GToken) Credentials

func (t *GToken) Credentials() (*oauth2.Config, error)

Credentials reads google client config file and returns a deserialized struct on success

func (GToken) Get

func (t GToken) Get(ctx context.Context, handleAuthFunc ConsentHandlerFunc) (*oauth2.Token, error)

Get returns a google access token

Jump to

Keyboard shortcuts

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