gcp

package
v0.0.0-...-b26c292 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gcp provides fundamental Wire providers and types for Google Cloud Platform (GCP).

Index

Constants

This section is empty.

Variables

DefaultIdentity is a Wire provider set that provides the project ID and token source from Application Default Credentials (ADC).

Functions

func DefaultCredentials

func DefaultCredentials(ctx context.Context) (*google.Credentials, error)

DefaultCredentials obtains the default GCP credentials with Cloud Platform scope.

func DefaultTransport

func DefaultTransport() http.RoundTripper

DefaultTransport returns http.DefaultTransport.

Types

type HTTPClient

type HTTPClient struct {
	http.Client
}

HTTPClient is an HTTP client that makes requests authenticated with Cloud- Platform-scoped authentication tokens.

func NewAnonymousHTTPClient

func NewAnonymousHTTPClient(transport http.RoundTripper) *HTTPClient

NewAnonymousHTTPClient creates a new anonymous HTTP client.

func NewHTTPClient

func NewHTTPClient(transport http.RoundTripper, ts TokenSource) (*HTTPClient, error)

NewHTTPClient creates a new authenticated HTTP client.

type ProjectID

type ProjectID string

ProjectID is a GCP Project ID.

func DefaultProjectID

func DefaultProjectID(creds *google.Credentials) (ProjectID, error)

DefaultProjectID obtains the project ID from the default GCP credentials.

type TokenSource

type TokenSource oauth2.TokenSource

TokenSource wraps a GCP token source that provides Cloud-Platform- scoped tokens.

func CredentialsTokenSource

func CredentialsTokenSource(creds *google.Credentials) TokenSource

CredentialsTokenSource extracts the token source from GCP credentials.

Directories

Path Synopsis
Package cloudsql contains Wire providers that are common across Google Cloud SQL.
Package cloudsql contains Wire providers that are common across Google Cloud SQL.
Package gcpcloud contains Wire providers for GCP services.
Package gcpcloud contains Wire providers for GCP services.

Jump to

Keyboard shortcuts

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