serviceaccount

package
v0.0.0-...-e0f9f6e Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2015 License: Apache-2.0, BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

The serviceaccount package provides support for making OAuth2-authorized HTTP requests from App Engine using service accounts.

See: https://developers.google.com/appengine/docs/go/reference#AccessToken

Example usage:

c := appengine.NewContext()
client, err := serviceaccount.NewClient(c, "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/bigquery")
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(c appengine.Context, scopes ...string) (*http.Client, error)

NewClient returns an *http.Client authorized for the given scopes with the service account owned by the application. Tokens are cached in memcache until they expire.

Types

This section is empty.

Jump to

Keyboard shortcuts

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