internal

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package internal contains support packages for oauth2 package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextClient

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

func ContextTransport

func ContextTransport(ctx context.Context) http.RoundTripper

func RegisterContextClientFunc

func RegisterContextClientFunc(fn ContextClientFunc)

Types

type ContextClientFunc

type ContextClientFunc func(context.Context) (*http.Client, error)

ContextClientFunc is a func which tries to return an *http.Client given a Context value. If it returns an error, the search stops with that error. If it returns (nil, nil), the search continues down the list of registered funcs.

type ContextKey

type ContextKey struct{}

ContextKey is just an empty struct. It exists so HTTPClient can be an immutable public variable with a unique type. It's immutable because nobody else can create a ContextKey, being unexported.

var HTTPClient ContextKey

HTTPClient is the context key to use with golang.org/x/net/context's WithValue function to associate an *http.Client value with a context.

type ErrorTransport

type ErrorTransport struct{ Err error }

ErrorTransport returns the specified error on RoundTrip. This RoundTripper should be used in rare error cases where error handling can be postponed to response handling time.

func (ErrorTransport) RoundTrip

func (t ErrorTransport) RoundTrip(*http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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