Documentation ¶
Overview ¶
Package internal contains support packages for oauth2 package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextTransport ¶
func ContextTransport(ctx context.Context) http.RoundTripper
func RegisterContextClientFunc ¶
func RegisterContextClientFunc(fn ContextClientFunc)
Types ¶
type ContextClientFunc ¶
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.