api: google.golang.org/api/internal Index | Files | Directories

package internal

import "google.golang.org/api/internal"

Package internal supports the options and transport packages.

Index

Package Files

conn_pool.go creds.go settings.go

func Creds Uses

func Creds(ctx context.Context, ds *DialSettings) (*google.Credentials, error)

Creds returns credential information obtained from DialSettings, or if none, then it returns default credential information.

func QuotaProjectFromCreds Uses

func QuotaProjectFromCreds(cred *google.Credentials) string

QuotaProjectFromCreds returns the quota project from the JSON blob in the provided credentials.

NOTE(cbro): consider promoting this to a field on google.Credentials.

type ConnPool Uses

type ConnPool interface {
    // Conn returns a ClientConn from the pool.
    //
    // Conns aren't returned to the pool.
    Conn() *grpc.ClientConn

    // Num returns the number of connections in the pool.
    //
    // It will always return the same value.
    Num() int

    // Close closes every ClientConn in the pool.
    //
    // The error returned by Close may be a single error or multiple errors.
    Close() error

    // ConnPool implements grpc.ClientConnInterface to enable it to be used directly with generated proto stubs.
    grpc.ClientConnInterface
}

ConnPool is a pool of grpc.ClientConns.

type DialSettings Uses

type DialSettings struct {
    Endpoint          string
    DefaultEndpoint   string
    Scopes            []string
    TokenSource       oauth2.TokenSource
    Credentials       *google.Credentials
    CredentialsFile   string // if set, Token Source is ignored.
    CredentialsJSON   []byte
    UserAgent         string
    APIKey            string
    Audiences         []string
    HTTPClient        *http.Client
    GRPCDialOpts      []grpc.DialOption
    GRPCConn          *grpc.ClientConn
    GRPCConnPool      ConnPool
    GRPCConnPoolSize  int
    NoAuth            bool
    TelemetryDisabled bool
    ClientCertSource  func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
    CustomClaims      map[string]interface{}

    // Google API system parameters. For more information please read:
    // https://cloud.google.com/apis/docs/system-parameters
    QuotaProject  string
    RequestReason string
}

DialSettings holds information needed to establish a connection with a Google API service.

func (*DialSettings) Validate Uses

func (ds *DialSettings) Validate() error

Validate reports an error if ds is invalid.

Directories

PathSynopsis
gensupportPackage gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
third_party/uritemplatesPackage uritemplates is a level 3 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
versionPackage version contains version information for Google Cloud Client Libraries for Go, as reported in request headers.

Package internal imports 10 packages (graph) and is imported by 51 packages. Updated 2020-05-29. Refresh now. Tools for package owners.