serviceaccount

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2014 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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