gcloud

package
v0.2.20 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

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

func FailedToLoadTokenSource(err error, logger *slog.Logger)

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.

Jump to

Keyboard shortcuts

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