serviceaccount

package
Version: v0.0.0-...-6079644 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package serviceaccount provides support for making OAuth2-authorized HTTP requests from Google Compute Engine instances using service accounts.

See: https://developers.google.com/compute/docs/authentication

Example usage:

client, err := serviceaccount.NewClient(&serviceaccount.Options{})
if err != nil {
	c.Errorf("failed to create service account client: %q", err)
	return err
}
client.Post("https://www.googleapis.com/compute/...", ...)
client.Post("https://www.googleapis.com/bigquery/...", ...)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(opt *Options) (*http.Client, error)

NewClient returns an *http.Client authorized with the service account configured in the Google Compute Engine instance.

Types

type Options

type Options struct {
	// Underlying transport of service account Client.
	// If nil, http.DefaultTransport is used.
	Transport http.RoundTripper

	// Service account name.
	// If empty, "default" is used.
	Account string
}

Options configures a service account Client.

Jump to

Keyboard shortcuts

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