2015-08-26 20:42:02 -04:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
2014-12-09 18:17:33 -05:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-08-31 23:16:23 -04:00
|
|
|
// +build appengine
|
2014-12-09 18:17:33 -05:00
|
|
|
|
|
|
|
// App Engine hooks.
|
|
|
|
|
|
|
|
package oauth2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2015-02-26 00:53:51 -05:00
|
|
|
"golang.org/x/net/context"
|
2015-01-16 17:43:33 -05:00
|
|
|
"golang.org/x/oauth2/internal"
|
2015-02-26 00:53:51 -05:00
|
|
|
"google.golang.org/appengine/urlfetch"
|
2014-12-09 18:17:33 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2015-01-16 17:43:33 -05:00
|
|
|
internal.RegisterContextClientFunc(contextClientAppEngine)
|
2014-12-09 18:17:33 -05:00
|
|
|
}
|
|
|
|
|
2015-02-26 00:53:51 -05:00
|
|
|
func contextClientAppEngine(ctx context.Context) (*http.Client, error) {
|
|
|
|
return urlfetch.Client(ctx), nil
|
2014-12-09 18:17:33 -05:00
|
|
|
}
|