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.

335 lines
11 KiB

8 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="theme-color" content="#375EAB">
  7. <title>internal - The Go Programming Language</title>
  8. <link type="text/css" rel="stylesheet" href="../../../../lib/godoc/style.css">
  9. <link rel="stylesheet" href="../../../../lib/godoc/jquery.treeview.css">
  10. <script type="text/javascript">window.initFuncs = [];</script>
  11. </head>
  12. <body>
  13. <div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
  14. ...
  15. </div><!-- #lowframe -->
  16. <div id="topbar" class="wide"><div class="container">
  17. <div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
  18. <div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
  19. <a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
  20. <form method="GET" action="http://localhost:6060/search">
  21. <div id="menu">
  22. <a href="http://localhost:6060/doc/">Documents</a>
  23. <a href="http://localhost:6060/pkg/">Packages</a>
  24. <a href="http://localhost:6060/project/">The Project</a>
  25. <a href="http://localhost:6060/help/">Help</a>
  26. <a href="http://localhost:6060/blog/">Blog</a>
  27. <input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
  28. </div>
  29. </form>
  30. </div></div>
  31. <div id="page" class="wide">
  32. <div class="container">
  33. <h1>Package internal</h1>
  34. <div id="nav"></div>
  35. <!--
  36. Copyright 2009 The Go Authors. All rights reserved.
  37. Use of this source code is governed by a BSD-style
  38. license that can be found in the LICENSE file.
  39. -->
  40. <!--
  41. Note: Static (i.e., not template-generated) href and id
  42. attributes start with "pkg-" to make it impossible for
  43. them to conflict with generated attributes (some of which
  44. correspond to Go identifiers).
  45. -->
  46. <script type='text/javascript'>
  47. document.ANALYSIS_DATA = null;
  48. document.CALLGRAPH = null;
  49. </script>
  50. <div id="short-nav">
  51. <dl>
  52. <dd><code>import "net/http/internal"</code></dd>
  53. </dl>
  54. <dl>
  55. <dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
  56. <dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
  57. </dl>
  58. </div>
  59. <!-- The package's Name is printed as title by the top-level template -->
  60. <div id="pkg-overview" class="toggleVisible">
  61. <div class="collapsed">
  62. <h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
  63. </div>
  64. <div class="expanded">
  65. <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
  66. <p>
  67. Package internal contains HTTP internals shared by net/http and
  68. net/http/httputil.
  69. </p>
  70. </div>
  71. </div>
  72. <div id="pkg-index" class="toggleVisible">
  73. <div class="collapsed">
  74. <h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
  75. </div>
  76. <div class="expanded">
  77. <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
  78. <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
  79. <div id="manual-nav">
  80. <dl>
  81. <dd><a href="index.html#pkg-variables">Variables</a></dd>
  82. <dd><a href="index.html#NewChunkedReader">func NewChunkedReader(r io.Reader) io.Reader</a></dd>
  83. <dd><a href="index.html#NewChunkedWriter">func NewChunkedWriter(w io.Writer) io.WriteCloser</a></dd>
  84. <dd><a href="index.html#FlushAfterChunkWriter">type FlushAfterChunkWriter</a></dd>
  85. </dl>
  86. </div><!-- #manual-nav -->
  87. <h4>Package files</h4>
  88. <p>
  89. <span style="font-size:90%">
  90. <a href="http://localhost:6060/src/net/http/internal/chunked.go">chunked.go</a>
  91. <a href="http://localhost:6060/src/net/http/internal/testcert.go">testcert.go</a>
  92. </span>
  93. </p>
  94. </div><!-- .expanded -->
  95. </div><!-- #pkg-index -->
  96. <div id="pkg-callgraph" class="toggle" style="display: none">
  97. <div class="collapsed">
  98. <h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
  99. </div> <!-- .expanded -->
  100. <div class="expanded">
  101. <h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
  102. <p>
  103. In the call graph viewer below, each node
  104. is a function belonging to this package
  105. and its children are the functions it
  106. calls&mdash;perhaps dynamically.
  107. </p>
  108. <p>
  109. The root nodes are the entry points of the
  110. package: functions that may be called from
  111. outside the package.
  112. There may be non-exported or anonymous
  113. functions among them if they are called
  114. dynamically from another package.
  115. </p>
  116. <p>
  117. Click a node to visit that function's source code.
  118. From there you can visit its callers by
  119. clicking its declaring <code>func</code>
  120. token.
  121. </p>
  122. <p>
  123. Functions may be omitted if they were
  124. determined to be unreachable in the
  125. particular programs or tests that were
  126. analyzed.
  127. </p>
  128. <!-- Zero means show all package entry points. -->
  129. <ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
  130. </div>
  131. </div> <!-- #pkg-callgraph -->
  132. <h2 id="pkg-variables">Variables</h2>
  133. <pre>var <span id="ErrLineTooLong">ErrLineTooLong</span> = <a href="../../../errors/index.html">errors</a>.<a href="../../../errors/index.html#New">New</a>(&#34;header line too long&#34;)</pre>
  134. <pre>var <span id="LocalhostCert">LocalhostCert</span> = []<a href="../../../builtin/index.html#byte">byte</a>(`-----BEGIN CERTIFICATE-----
  135. MIICEzCCAXygAwIBAgIQMIMChMLGrR+QvmQvpwAU6zANBgkqhkiG9w0BAQsFADAS
  136. MRAwDgYDVQQKEwdBY21lIENvMCAXDTcwMDEwMTAwMDAwMFoYDzIwODQwMTI5MTYw
  137. MDAwWjASMRAwDgYDVQQKEwdBY21lIENvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
  138. iQKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9SjY1bIw4
  139. iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZBl2+XsDul
  140. rKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQABo2gwZjAO
  141. BgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUw
  142. AwEB/zAuBgNVHREEJzAlggtleGFtcGxlLmNvbYcEfwAAAYcQAAAAAAAAAAAAAAAA
  143. AAAAATANBgkqhkiG9w0BAQsFAAOBgQCEcetwO59EWk7WiJsG4x8SY+UIAA+flUI9
  144. tyC4lNhbcF2Idq9greZwbYCqTTTr2XiRNSMLCOjKyI7ukPoPjo16ocHj+P3vZGfs
  145. h1fIw3cSS2OolhloGw/XM6RWPWtPAlGykKLciQrBru5NAPvCMsb/I1DAceTiotQM
  146. fblo6RBxUQ==
  147. -----END CERTIFICATE-----`)</pre>
  148. <p>
  149. LocalhostCert is a PEM-encoded TLS cert with SAN IPs
  150. &#34;127.0.0.1&#34; and &#34;[::1]&#34;, expiring at Jan 29 16:00:00 2084 GMT.
  151. generated from src/crypto/tls:
  152. go run generate_cert.go --rsa-bits 1024 --host 127.0.0.1,::1,example.com --ca --start-date &#34;Jan 1 00:00:00 1970&#34; --duration=1000000h
  153. </p>
  154. <pre>var <span id="LocalhostKey">LocalhostKey</span> = []<a href="../../../builtin/index.html#byte">byte</a>(`-----BEGIN RSA PRIVATE KEY-----
  155. MIICXgIBAAKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9
  156. SjY1bIw4iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZB
  157. l2+XsDulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB
  158. AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
  159. 3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
  160. uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
  161. qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
  162. jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
  163. fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
  164. fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU
  165. y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj013sovGKUFfYAqVXVlxtIX
  166. qyUBnu3X9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dJDaFeo
  167. f9Oeos0UUothgiDktdQHxdNEwLjQf7lJJBzV+5OtwswCWA==
  168. -----END RSA PRIVATE KEY-----`)</pre>
  169. <p>
  170. LocalhostKey is the private key for localhostCert.
  171. </p>
  172. <h2 id="NewChunkedReader">func <a href="http://localhost:6060/src/net/http/internal/chunked.go?s=857:901#L19">NewChunkedReader</a></h2>
  173. <pre>func NewChunkedReader(r <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#Reader">Reader</a>) <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#Reader">Reader</a></pre>
  174. <p>
  175. NewChunkedReader returns a new chunkedReader that translates the data read from r
  176. out of HTTP &#34;chunked&#34; format before returning it.
  177. The chunkedReader returns io.EOF when the final 0-length chunk is read.
  178. </p>
  179. <p>
  180. NewChunkedReader is not needed by normal applications. The http package
  181. automatically decodes chunking when reading response bodies.
  182. </p>
  183. <h2 id="NewChunkedWriter">func <a href="http://localhost:6060/src/net/http/internal/chunked.go?s=4296:4345#L159">NewChunkedWriter</a></h2>
  184. <pre>func NewChunkedWriter(w <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#Writer">Writer</a>) <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#WriteCloser">WriteCloser</a></pre>
  185. <p>
  186. NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP
  187. &#34;chunked&#34; format before writing them to w. Closing the returned chunkedWriter
  188. sends the final 0-length chunk that marks the end of the stream.
  189. </p>
  190. <p>
  191. NewChunkedWriter is not needed by normal applications. The http
  192. package adds chunking automatically if handlers don&#39;t set a
  193. Content-Length header. Using newChunkedWriter inside a handler
  194. would result in double chunking or chunking with a Content-Length
  195. length, both of which are wrong.
  196. </p>
  197. <h2 id="FlushAfterChunkWriter">type <a href="http://localhost:6060/src/net/http/internal/chunked.go?s=5731:5783#L208">FlushAfterChunkWriter</a></h2>
  198. <pre>type FlushAfterChunkWriter struct {
  199. *<a href="../../../bufio/index.html">bufio</a>.<a href="../../../bufio/index.html#Writer">Writer</a>
  200. }</pre>
  201. <p>
  202. FlushAfterChunkWriter signals from the caller of NewChunkedWriter
  203. that each chunk should be followed by a flush. It is used by the
  204. http.Transport code to keep the buffering behavior for headers and
  205. trailers, but flush out chunks aggressively in the middle for
  206. request bodies which may be generated slowly. See Issue 6574.
  207. </p>
  208. <div id="footer">
  209. Build version go1.6.<br>
  210. Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
  211. the content of this page is licensed under the
  212. Creative Commons Attribution 3.0 License,
  213. and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
  214. <a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
  215. <a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
  216. </div>
  217. </div><!-- .container -->
  218. </div><!-- #page -->
  219. <!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
  220. <script type="text/javascript" src="../../../../lib/godoc/jquery.js"></script>
  221. <script type="text/javascript" src="../../../../lib/godoc/jquery.treeview.js"></script>
  222. <script type="text/javascript" src="../../../../lib/godoc/jquery.treeview.edit.js"></script>
  223. <script type="text/javascript" src="../../../../lib/godoc/godocs.js"></script>
  224. </body>
  225. </html>