You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

476 lines
16 KiB

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB">
<title>internal - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../lib/godoc/style.css">
<link rel="stylesheet" href="../../../../../lib/godoc/jquery.treeview.css">
<script type="text/javascript">window.initFuncs = [];</script>
</head>
<body>
<div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
...
</div><!-- #lowframe -->
<div id="topbar" class="wide"><div class="container">
<div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
<div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
<a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
<form method="GET" action="http://localhost:6060/search">
<div id="menu">
<a href="http://localhost:6060/doc/">Documents</a>
<a href="http://localhost:6060/pkg/">Packages</a>
<a href="http://localhost:6060/project/">The Project</a>
<a href="http://localhost:6060/help/">Help</a>
<a href="http://localhost:6060/blog/">Blog</a>
<input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
</div>
</form>
</div></div>
<div id="page" class="wide">
<div class="container">
<h1>Package internal</h1>
<div id="nav"></div>
<!--
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!--
Note: Static (i.e., not template-generated) href and id
attributes start with "pkg-" to make it impossible for
them to conflict with generated attributes (some of which
correspond to Go identifiers).
-->
<script type='text/javascript'>
document.ANALYSIS_DATA = null;
document.CALLGRAPH = null;
</script>
<div id="short-nav">
<dl>
<dd><code>import "golang.org/x/oauth2/internal"</code></dd>
</dl>
<dl>
<dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
<dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
</dl>
</div>
<!-- The package's Name is printed as title by the top-level template -->
<div id="pkg-overview" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package internal contains support packages for oauth2 package.
</p>
<p>
Package internal contains support packages for oauth2 package.
</p>
<p>
Package internal contains support packages for oauth2 package.
</p>
</div>
</div>
<div id="pkg-index" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
<div id="manual-nav">
<dl>
<dd><a href="index.html#CondVal">func CondVal(v string) []string</a></dd>
<dd><a href="index.html#ContextClient">func ContextClient(ctx context.Context) (*http.Client, error)</a></dd>
<dd><a href="index.html#ContextTransport">func ContextTransport(ctx context.Context) http.RoundTripper</a></dd>
<dd><a href="index.html#ParseINI">func ParseINI(ini io.Reader) (map[string]map[string]string, error)</a></dd>
<dd><a href="index.html#ParseKey">func ParseKey(key []byte) (*rsa.PrivateKey, error)</a></dd>
<dd><a href="index.html#RegisterBrokenAuthHeaderProvider">func RegisterBrokenAuthHeaderProvider(tokenURL string)</a></dd>
<dd><a href="index.html#RegisterContextClientFunc">func RegisterContextClientFunc(fn ContextClientFunc)</a></dd>
<dd><a href="index.html#ContextClientFunc">type ContextClientFunc</a></dd>
<dd><a href="index.html#ContextKey">type ContextKey</a></dd>
<dd><a href="index.html#ErrorTransport">type ErrorTransport</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#ErrorTransport.RoundTrip">func (t ErrorTransport) RoundTrip(*http.Request) (*http.Response, error)</a></dd>
<dd><a href="index.html#Token">type Token</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#RetrieveToken">func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values) (*Token, error)</a></dd>
</dl>
</div><!-- #manual-nav -->
<h4>Package files</h4>
<p>
<span style="font-size:90%">
<a href="http://localhost:6060/src/golang.org/x/oauth2/internal/oauth2.go">oauth2.go</a>
<a href="http://localhost:6060/src/golang.org/x/oauth2/internal/token.go">token.go</a>
<a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go">transport.go</a>
</span>
</p>
</div><!-- .expanded -->
</div><!-- #pkg-index -->
<div id="pkg-callgraph" class="toggle" style="display: none">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
</div> <!-- .expanded -->
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
<p>
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls&mdash;perhaps dynamically.
</p>
<p>
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
</p>
<p>
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring <code>func</code>
token.
</p>
<p>
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
</p>
<!-- Zero means show all package entry points. -->
<ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
</div>
</div> <!-- #pkg-callgraph -->
<h2 id="CondVal">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/oauth2.go?s=1967:1998#L61">CondVal</a></h2>
<pre>func CondVal(v <a href="../../../../builtin/index.html#string">string</a>) []<a href="../../../../builtin/index.html#string">string</a></pre>
<h2 id="ContextClient">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=1163:1224#L25">ContextClient</a></h2>
<pre>func ContextClient(ctx <a href="../../net/context/index.html">context</a>.<a href="../../net/context/index.html#Context">Context</a>) (*<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Client">Client</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<h2 id="ContextTransport">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=1504:1564#L43">ContextTransport</a></h2>
<pre>func ContextTransport(ctx <a href="../../net/context/index.html">context</a>.<a href="../../net/context/index.html#Context">Context</a>) <a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#RoundTripper">RoundTripper</a></pre>
<h2 id="ParseINI">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/oauth2.go?s=1135:1201#L33">ParseINI</a></h2>
<pre>func ParseINI(ini <a href="../../../../io/index.html">io</a>.<a href="../../../../io/index.html#Reader">Reader</a>) (map[<a href="../../../../builtin/index.html#string">string</a>]map[<a href="../../../../builtin/index.html#string">string</a>]<a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<h2 id="ParseKey">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/oauth2.go?s=636:686#L14">ParseKey</a></h2>
<pre>func ParseKey(key []<a href="../../../../builtin/index.html#byte">byte</a>) (*<a href="../../../../crypto/rsa/index.html">rsa</a>.<a href="../../../../crypto/rsa/index.html#PrivateKey">PrivateKey</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<p>
ParseKey converts the binary contents of a private key file
to an *rsa.PrivateKey. It detects whether the private key is in a
PEM container or not. If so, it extracts the the private key
from PEM container before conversion. It only supports PEM
containers with no passphrase.
</p>
<h2 id="RegisterBrokenAuthHeaderProvider">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/token.go?s=3374:3428#L112">RegisterBrokenAuthHeaderProvider</a></h2>
<pre>func RegisterBrokenAuthHeaderProvider(tokenURL <a href="../../../../builtin/index.html#string">string</a>)</pre>
<h2 id="RegisterContextClientFunc">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=1052:1104#L21">RegisterContextClientFunc</a></h2>
<pre>func RegisterContextClientFunc(fn <a href="index.html#ContextClientFunc">ContextClientFunc</a>)</pre>
<h2 id="ContextClientFunc">type <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=940:1006#L17">ContextClientFunc</a></h2>
<pre>type ContextClientFunc func(<a href="../../net/context/index.html">context</a>.<a href="../../net/context/index.html#Context">Context</a>) (*<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Client">Client</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<p>
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.
</p>
<h2 id="ContextKey">type <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=672:696#L11">ContextKey</a></h2>
<pre>type ContextKey struct{}</pre>
<p>
ContextKey is just an empty struct. It exists so HTTPClient can be
an immutable public variable with a unique type. It&#39;s immutable
because nobody else can create a ContextKey, being unexported.
</p>
<pre>var <span id="HTTPClient">HTTPClient</span> <a href="index.html#ContextKey">ContextKey</a></pre>
<p>
HTTPClient is the context key to use with golang.org/x/net/context&#39;s
WithValue function to associate an *http.Client value with a context.
</p>
<h2 id="ErrorTransport">type <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=1921:1960#L55">ErrorTransport</a></h2>
<pre>type ErrorTransport struct{ Err <a href="../../../../builtin/index.html#error">error</a> }</pre>
<p>
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.
</p>
<h3 id="ErrorTransport.RoundTrip">func (ErrorTransport) <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/transport.go?s=1962:2034#L57">RoundTrip</a></h3>
<pre>func (t <a href="index.html#ErrorTransport">ErrorTransport</a>) RoundTrip(*<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Request">Request</a>) (*<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Response">Response</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<h2 id="Token">type <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/token.go?s=717:1472#L20">Token</a></h2>
<pre>type Token struct {
<span class="comment">// AccessToken is the token that authorizes and authenticates</span>
<span class="comment">// the requests.</span>
AccessToken <a href="../../../../builtin/index.html#string">string</a>
<span class="comment">// TokenType is the type of token.</span>
<span class="comment">// The Type method returns either this or &#34;Bearer&#34;, the default.</span>
TokenType <a href="../../../../builtin/index.html#string">string</a>
<span class="comment">// RefreshToken is a token that&#39;s used by the application</span>
<span class="comment">// (as opposed to the user) to refresh the access token</span>
<span class="comment">// if it expires.</span>
RefreshToken <a href="../../../../builtin/index.html#string">string</a>
<span class="comment">// Expiry is the optional expiration time of the access token.</span>
<span class="comment">//</span>
<span class="comment">// If zero, TokenSource implementations will reuse the same</span>
<span class="comment">// token forever and RefreshToken or equivalent</span>
<span class="comment">// mechanisms for that TokenSource will not be used.</span>
Expiry <a href="../../../../time/index.html">time</a>.<a href="../../../../time/index.html#Time">Time</a>
<span class="comment">// Raw optionally contains extra metadata from the server</span>
<span class="comment">// when updating a token.</span>
Raw interface{}
}</pre>
<p>
Token represents the crendentials used to authorize
the requests to access protected resources on the OAuth 2.0
provider&#39;s backend.
</p>
<p>
This type is a mirror of oauth2.Token and exists to break
an otherwise-circular dependency. Other internal packages
should convert this Token into an oauth2.Token before use.
</p>
<h3 id="RetrieveToken">func <a href="http://localhost:6060/src/golang.org/x/oauth2/internal/token.go?s=4480:4590#L139">RetrieveToken</a></h3>
<pre>func RetrieveToken(ctx <a href="../../net/context/index.html">context</a>.<a href="../../net/context/index.html#Context">Context</a>, clientID, clientSecret, tokenURL <a href="../../../../builtin/index.html#string">string</a>, v <a href="../../../../net/url/index.html">url</a>.<a href="../../../../net/url/index.html#Values">Values</a>) (*<a href="index.html#Token">Token</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<div id="footer">
Build version go1.6.<br>
Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
the content of this page is licensed under the
Creative Commons Attribution 3.0 License,
and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
<a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
</div>
</div><!-- .container -->
</div><!-- #page -->
<!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
<script type="text/javascript" src="../../../../../lib/godoc/jquery.js"></script>
<script type="text/javascript" src="../../../../../lib/godoc/jquery.treeview.js"></script>
<script type="text/javascript" src="../../../../../lib/godoc/jquery.treeview.edit.js"></script>
<script type="text/javascript" src="../../../../../lib/godoc/godocs.js"></script>
</body>
</html>