package serviceaccount

import "k8s.io/kubernetes/Godeps/_workspace/src/code.google.com/p/goauth2/compute/serviceaccount"

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

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.

Source Files

serviceaccount.go

Version
v0.6.2
Published
Dec 12, 2014
Platform
windows/amd64
Imports
7 packages
Last checked
21 minutes ago

Tools for package owners.