Versions in this module Expand all Collapse all v0 v0.18.2 Jun 9, 2023 Changes in this version + const ClientSecretEnv + const EnvGoogleAppCredentials + const EnvGoogleAppScopes + const GoogleAPIEmailURL + const GoogleAPIPlusPeopleURL + const GoogleAPIURLUserinfo + const GoogleAPIUserinfoURL + const ScopeDrive + const ScopeDriveFile + const ScopeDriveRead + const ScopePresentations + const ScopePresentationsRead + const ScopeSpreadsheets + const ScopeSpreadsheetsRead + const ScopeUserEmail + const ScopeUserProfile + func ClientFromFile(ctx context.Context, filepath string, scopes []string, tok *oauth2.Token) (*http.Client, error) + func ConfigFromBytes(configJSON []byte, scopes []string) (*oauth2.Config, error) + func ConfigFromEnv(envVar string, scopes []string) (*oauth2.Config, error) + func ConfigFromFile(file string, scopes []string) (*oauth2.Config, error) + func HTTPGetBearerToken(url, token string) (*http.Response, error) + func HTTPGetBearerTokenBody(url, token string) (*http.Response, []byte, error) + func NewClientFileStore(credentials []byte, scopes []string, tokenPath string, useDefaultDir bool, ...) (*http.Client, error) + func NewClientFileStoreWithDefaults(googleCredentials []byte, googleScopes []string, forceNewToken bool) (*http.Client, error) + func NewClientFileStoreWithDefaultsCliEnv(googleCredentialsEnvVar, googleScopesEnvVar string) (*http.Client, error) + func NewClientFromJWTJSON(ctx context.Context, svcAccountConfig []byte, scopes ...string) (*http.Client, error) + func NewClientOauthCliTokenStore(cfg ClientOauthCliTokenStoreConfig) (*http.Client, error) + func NewClientSvcAccountFromFile(ctx context.Context, svcAccountConfigFile string, scopes ...string) (*http.Client, error) + type ClientOauthCliTokenStoreConfig struct + AppConfig []byte + Context context.Context + ForceNewToken bool + Scopes []string + State string + TokenFile string + type ClientUtil struct + Client *http.Client + User GoogleUserinfo + func NewClientUtil(client *http.Client) ClientUtil + func (apiutil *ClientUtil) GetPlusPerson() (GooglePlusPerson, error) + func (apiutil *ClientUtil) GetSCIMUser() (scim.User, error) + func (apiutil *ClientUtil) GetSCIMUserOld() (scim.User, error) + func (apiutil *ClientUtil) GetUserinfo() (GoogleUserinfo, error) + func (apiutil *ClientUtil) GetUserinfoEmail() (GoogleUserinfoEmail, error) + func (apiutil *ClientUtil) SetClient(client *http.Client) + type Credentials struct + AuthProviderX509CertURL string + AuthURI string + ClientEmail string + ClientID string + ClientSecret string + ClientX509CertURL string + PrivateKey string + PrivateKeyID string + ProjectID string + RedirectURIs []string + TokenURI string + Type string + func CredentialsFromFile(file string) (Credentials, error) + type CredentialsContainer struct + Raw []byte + Scopes []string + Web *Credentials + func CredentialsContainerFromBytes(bytes []byte) (CredentialsContainer, error) + func CredentialsContainerFromFile(file string) (CredentialsContainer, error) + func (cc *CredentialsContainer) Credentials() *Credentials + func (cc *CredentialsContainer) OAuth2Config(scopes ...string) (*oauth2.Config, error) + type GoogleConfigFileStore struct + Credentials *Credentials + CredentialsRaw []byte + ForceNewToken bool + OAuthConfig *oauth2.Config + Scopes []string + State string + TokenPath string + UseDefaultDir bool + func (gc *GoogleConfigFileStore) Client() (*http.Client, error) + func (gc *GoogleConfigFileStore) LoadCredentialsBytes(bytes []byte) error + func (gc *GoogleConfigFileStore) SetDefaultFilepath() error + type GooglePlusPerson struct + DisplayName string + Etag string + Gender string + ID string + Image GooglePlusPersonImage + IsPlusUser bool + Kind string + Language string + Name GooglePlusPersonName + ObjectType string + URL string + Verified bool + type GooglePlusPersonImage struct + IsDefault bool + URL string + type GooglePlusPersonName struct + FamilyName string + GivenName string + type GoogleUserinfo struct + FamilyName string + Gender string + GivenName string + ID string + Link string + Locale string + Name string + PictureURL string + type GoogleUserinfoEmail struct + Email string + IsVerified bool + func ParseGoogleUserinfoEmail(query string) (GoogleUserinfoEmail, error) + type GoogleUserinfoOpenIDConnectV2 struct + Email string + EmailVerfied bool + FamilyName string + GivenName string + Locale string + Name string + Picture string + Sub string + func GetMeInfo(bearerToken string) (GoogleUserinfoOpenIDConnectV2, error)