gocloud.dev: gocloud.dev/gcp Index | Files | Directories

package gcp

import "gocloud.dev/gcp"

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

Index

Package Files

gcp.go

Variables

var DefaultIdentity = wire.NewSet(
    CredentialsTokenSource,
    DefaultCredentials,
    DefaultProjectID)

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

func DefaultCredentials Uses

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

DefaultCredentials obtains the default GCP credentials with Cloud Platform scope.

func DefaultTransport Uses

func DefaultTransport() http.RoundTripper

DefaultTransport returns http.DefaultTransport.

type HTTPClient Uses

type HTTPClient struct {
    http.Client
}

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

func NewHTTPClient Uses

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

NewHTTPClient creates a new authenticated HTTP client.

type ProjectID Uses

type ProjectID string

ProjectID is a GCP Project ID.

func DefaultProjectID Uses

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

DefaultProjectID obtains the project ID from the default GCP credentials.

type TokenSource Uses

type TokenSource oauth2.TokenSource

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

func CredentialsTokenSource Uses

func CredentialsTokenSource(creds *google.Credentials) TokenSource

CredentialsTokenSource extracts the token source from GCP credentials.

Directories

PathSynopsis
cloudsqlPackage cloudsql contains Wire providers that are common across Google Cloud SQL.
gcpcloudPackage gcpcloud contains Wire providers for GCP services.

Package gcp imports 6 packages (graph) and is imported by 25 packages. Updated 2019-07-19. Refresh now. Tools for package owners.