internal

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2016 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package internal provides support for the cloud packages.

Users should not import this package directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPClient added in v1.0.0

func HTTPClient(ctx context.Context) *http.Client

func ProjID added in v1.0.0

func ProjID(ctx context.Context) string

func Service added in v1.0.0

func Service(ctx context.Context, name string, fill func(*http.Client) interface{}) interface{}

Service returns the result of the fill function if it's never been called before for the given name (which is assumed to be an API service name, like "datastore"). If it has already been cached, the fill func is not run. It's safe for concurrent use by multiple goroutines.

func WithContext added in v1.0.0

func WithContext(parent context.Context, projID string, c *http.Client) context.Context

Types

type Transport added in v1.0.0

type Transport struct {
	// Base is the actual http.RoundTripper
	// requests will use. It must not be nil.
	Base http.RoundTripper
}

Transport is an http.RoundTripper that appends Google Cloud client's user-agent to the original request's user-agent header.

func (*Transport) RoundTrip added in v1.0.0

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip appends a user-agent to the existing user-agent header and delegates the request to the base http.RoundTripper.

Jump to

Keyboard shortcuts

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