oauth2

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package oauth2 implements a utility Config that can be made a flag and turned into a proper Context or http Client for use with Google apis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectID  string
	GCEAccount string

	ConfigFile string
	Scopes     []string
}

Config represents an oauth2 configuration, usually in the context of Google services.

func NewConfigFlags

func NewConfigFlags(flag *flag.FlagSet) *Config

NewConfigFlags returns a Config with fields exposed by flags.

func (*Config) Client

func (c *Config) Client(ctx context.Context) (*http.Client, error)

Client returns an oauth2-based http.Client based on the receiver Config.

func (*Config) Context

func (c *Config) Context(ctx context.Context) (context.Context, error)

Context returns an cloud.Context based on the receiver Config.

Jump to

Keyboard shortcuts

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