google

package
v0.0.0-...-4d42741 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Drive

type Drive interface {
	UpLoad(file multipart.File, fileName string) (*drive.File, error)
}

func NewDriveUpload

func NewDriveUpload(accessToken string, ctx *gin.Context) Drive

type DriveUpload

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

func (*DriveUpload) UpLoad

func (d *DriveUpload) UpLoad(file multipart.File, fileName string) (*drive.File, error)

type GoogleAuth

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

func (*GoogleAuth) CodeAuthentication

func (d *GoogleAuth) CodeAuthentication(code string) (*oauth2.Token, error)

func (*GoogleAuth) CreateAuthURL

func (g *GoogleAuth) CreateAuthURL() string

func (*GoogleAuth) GetEmailFromAccessToken

func (g *GoogleAuth) GetEmailFromAccessToken(accessToken string) (string, error)

func (*GoogleAuth) RefreshToken

func (g *GoogleAuth) RefreshToken(refreshToken string, clientId string, clientSecret string, storageId int64) (RefreshTokenReponse, error)

type GoogleAuthService

type GoogleAuthService interface {
	CreateAuthURL() string
	CodeAuthentication(code string) (*oauth2.Token, error)
	GetEmailFromAccessToken(accessToken string) (string, error)
	RefreshToken(refreshToken string, clientId string, clientSecret string, storageId int64) (RefreshTokenReponse, error)
}

func NewDrive

func NewDrive(oauth2Config *oauth2.Config, store db.Store) GoogleAuthService

type RefreshTokenReponse

type RefreshTokenReponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
	Scope       string `json:"scope"`
	TokenType   string `json:"token_type"`
	IdToken     string `json:"id_token"`
}

type RefreshTokenRequest

type RefreshTokenRequest struct {
	GrantType    string `json:"grant_type"`
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RefreshToken string `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

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