google

package
v0.0.0-...-394a65f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	IdentityProvider IdentityProvider
	Account          Account
}

API represents Google API client.

func NewAPI

func NewAPI(identityProvider IdentityProvider, account Account) API

NewAPI creates Google API client.

type Account

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

Account accesses user's account data through Google API.

func NewAccount

func NewAccount(http webreq.HTTP) Account

NewAccount initializes Google account API client.

func (Account) GetSingleSignOnUser

func (a Account) GetSingleSignOnUser(accessToken string) (entity.SSOUser, error)

GetSingleSignOnUser retrieves user's email and name from Google API.

type AccountLinker

type AccountLinker sso.AccountLinker

AccountLinker links user's Google account with Short account.

type IdentityProvider

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

IdentityProvider represents Google OAuth service.

func NewIdentityProvider

func NewIdentityProvider(http webreq.HTTP, clientID string, clientSecret string, redirectURI string) IdentityProvider

NewIdentityProvider initializes Google OAuth service.

func (IdentityProvider) GetAuthorizationURL

func (g IdentityProvider) GetAuthorizationURL() string

GetAuthorizationURL retrieves the URL of Google sign in page.

func (IdentityProvider) RequestAccessToken

func (g IdentityProvider) RequestAccessToken(authorizationCode string) (string, error)

RequestAccessToken retrieves access token of user's Google account using authorization code.

type SafeBrowsing

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

SafeBrowsing represents Googles SafeBrowsing APIs.

func NewSafeBrowsing

func NewSafeBrowsing(apiKey string, req webreq.HTTP) SafeBrowsing

NewSafeBrowsing initializes Google's SafeBrowsing API client.

func (SafeBrowsing) HasURL

func (s SafeBrowsing) HasURL(url string) (bool, error)

HasURL checks whether a given URL is blacklisted by Google.

type SingleSignOn

type SingleSignOn sso.SingleSignOn

SingleSignOn enables users to sign in through their Google account.

Jump to

Keyboard shortcuts

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