google

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Profile = "https://www.googleapis.com/auth/userinfo.profile" // 获取用户信息
	Email   = "https://www.googleapis.com/auth/userinfo.email"   // 获取用户邮箱
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth

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

func New

func New(opts ...Option) *OAuth

func (*OAuth) GetAuthPageURL added in v0.5.1

func (auth *OAuth) GetAuthPageURL() string

func (*OAuth) HandleAuth added in v0.5.1

func (auth *OAuth) HandleAuth(code *plugin.VerifyCode) (*plugin.User, error)

func (*OAuth) Provide

func (auth *OAuth) Provide(ctx context.Context) any

type Option

type Option func(o *Options)

func WithClientID

func WithClientID(clientID string) Option

func WithClientSecret

func WithClientSecret(clientSecret string) Option

func WithRedirectURL

func WithRedirectURL(redirectURL string) Option

func WithScope

func WithScope(scope []string) Option

type Options

type Options struct {
	ClientID     string
	ClientSecret string
	RedirectURL  string
	Scope        []string
	TTL          time.Duration
}

Jump to

Keyboard shortcuts

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