account

package
v0.0.0-...-ff7c5b8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientID      string = ""
	CallbackUrl   string = "/google/callback"
	ListenPort    int    = 9096
	GoogleAuthURL string = "https://accounts.google.com/o/oauth2/auth/oauthchooseaccount"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {
	AuthUser []string `json:"authuser"`
	Code     []string `json:"code"`
	HD       []string `json:"hd"`
	Scope    []string `json:"scope"`
	State    []string `json:"state"`
}

type DefaultGoogleAccount

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

func (*DefaultGoogleAccount) Login

func (gc *DefaultGoogleAccount) Login(ctx context.Context) (*AuthInfo, error)

type Interface

type Interface interface {
	// Login Call Google Account Oauth and get token code which returned.
	Login(ctx context.Context) (*AuthInfo, error)
}

func NewGoogleAccount

func NewGoogleAccount(opts ...OptionFunc) Interface

NewGoogleAccount Construction function for Google Account Interface, use factory method pattern.

type OptionFunc

type OptionFunc func(config *oauth2.Config)

func WithClientID

func WithClientID(clientID string) OptionFunc

func WithRedirectURL

func WithRedirectURL(redirectURL string) OptionFunc

Jump to

Keyboard shortcuts

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