Documentation
¶
Index ¶
- Variables
- func FailedToLoadTokenSource(err error, logger *slog.Logger)
- func LoadGoogleCredentials(ctx context.Context) (*google.Credentials, error)
- func LoadServiceAccountCredentials(ctx context.Context, url string, credentials *google.Credentials) (*oauth.TokenSource, error)
- func LoadedTokenSource(tokenSource *oauth.TokenSource, logger *slog.Logger)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilGoogleCredentials = errors.New("google credentials cannot be nil") ErrNilTokenSource = errors.New("token source cannot be nil") ErrFailedToLoadGoogleCredentials = errors.New("failed to load google credentials") ErrFailedToCreateTokenSource = errors.New("failed to create token source") )
Functions ¶
func FailedToLoadTokenSource ¶ added in v0.2.18
FailedToLoadTokenSource logs the failed to load token source
Parameters:
- err: the error
- logger: the logger
func LoadGoogleCredentials ¶
func LoadGoogleCredentials(ctx context.Context) (*google.Credentials, error)
LoadGoogleCredentials loads the Google credentials
Parameters:
- ctx: context.Context
Returns:
- *google.Credentials: Google credentials
- error: error if any
func LoadServiceAccountCredentials ¶
func LoadServiceAccountCredentials( ctx context.Context, url string, credentials *google.Credentials, ) (*oauth.TokenSource, error)
LoadServiceAccountCredentials loads the service account credentials
Parameters:
- ctx: context.Context
- url: string
- credentials: *google.Credentials
Returns:
- *oauth.TokenSource: OAuth2 token source
- error: error if any
func LoadedTokenSource ¶ added in v0.2.18
func LoadedTokenSource(tokenSource *oauth.TokenSource, logger *slog.Logger)
LoadedTokenSource logs the loaded token source
Parameters:
- tokenSource: the token source
- logger: the logger
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.