src_constants.js.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Source: src/constants.js</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Source: src/constants.js</h1>
  17. <section>
  18. <article>
  19. <pre class="prettyprint source linenums"><code>/**
  20. * @license
  21. * Copyright 2017, Google Inc.
  22. * All rights reserved.
  23. *
  24. * Redistribution and use in source and binary forms, with or without
  25. * modification, are permitted provided that the following conditions are
  26. * met:
  27. *
  28. * * Redistributions of source code must retain the above copyright
  29. * notice, this list of conditions and the following disclaimer.
  30. * * Redistributions in binary form must reproduce the above
  31. * copyright notice, this list of conditions and the following disclaimer
  32. * in the documentation and/or other materials provided with the
  33. * distribution.
  34. * * Neither the name of Google Inc. nor the names of its
  35. * contributors may be used to endorse or promote products derived from
  36. * this software without specific prior written permission.
  37. *
  38. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  39. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  40. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  41. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  42. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  43. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  44. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  45. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  46. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  47. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  48. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  49. *
  50. */
  51. /* The comments about status codes are copied verbatim (with some formatting
  52. * modifications) from include/grpc/impl/codegen/status.h, for the purpose of
  53. * including them in generated documentation.
  54. */
  55. /**
  56. * Enum of status codes that gRPC can return
  57. * @memberof grpc
  58. * @alias grpc.status
  59. * @readonly
  60. * @enum {number}
  61. */
  62. exports.status = {
  63. /** Not an error; returned on success */
  64. OK: 0,
  65. /** The operation was cancelled (typically by the caller). */
  66. CANCELLED: 1,
  67. /**
  68. * Unknown error. An example of where this error may be returned is
  69. * if a status value received from another address space belongs to
  70. * an error-space that is not known in this address space. Also
  71. * errors raised by APIs that do not return enough error information
  72. * may be converted to this error.
  73. */
  74. UNKNOWN: 2,
  75. /**
  76. * Client specified an invalid argument. Note that this differs
  77. * from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments
  78. * that are problematic regardless of the state of the system
  79. * (e.g., a malformed file name).
  80. */
  81. INVALID_ARGUMENT: 3,
  82. /**
  83. * Deadline expired before operation could complete. For operations
  84. * that change the state of the system, this error may be returned
  85. * even if the operation has completed successfully. For example, a
  86. * successful response from a server could have been delayed long
  87. * enough for the deadline to expire.
  88. */
  89. DEADLINE_EXCEEDED: 4,
  90. /** Some requested entity (e.g., file or directory) was not found. */
  91. NOT_FOUND: 5,
  92. /**
  93. * Some entity that we attempted to create (e.g., file or directory)
  94. * already exists.
  95. */
  96. ALREADY_EXISTS: 6,
  97. /**
  98. * The caller does not have permission to execute the specified
  99. * operation. PERMISSION_DENIED must not be used for rejections
  100. * caused by exhausting some resource (use RESOURCE_EXHAUSTED
  101. * instead for those errors). PERMISSION_DENIED must not be
  102. * used if the caller can not be identified (use UNAUTHENTICATED
  103. * instead for those errors).
  104. */
  105. PERMISSION_DENIED: 7,
  106. /**
  107. * Some resource has been exhausted, perhaps a per-user quota, or
  108. * perhaps the entire file system is out of space.
  109. */
  110. RESOURCE_EXHAUSTED: 8,
  111. /**
  112. * Operation was rejected because the system is not in a state
  113. * required for the operation's execution. For example, directory
  114. * to be deleted may be non-empty, an rmdir operation is applied to
  115. * a non-directory, etc.
  116. *
  117. * A litmus test that may help a service implementor in deciding
  118. * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
  119. *
  120. * - Use UNAVAILABLE if the client can retry just the failing call.
  121. * - Use ABORTED if the client should retry at a higher-level
  122. * (e.g., restarting a read-modify-write sequence).
  123. * - Use FAILED_PRECONDITION if the client should not retry until
  124. * the system state has been explicitly fixed. E.g., if an "rmdir"
  125. * fails because the directory is non-empty, FAILED_PRECONDITION
  126. * should be returned since the client should not retry unless
  127. * they have first fixed up the directory by deleting files from it.
  128. * - Use FAILED_PRECONDITION if the client performs conditional
  129. * REST Get/Update/Delete on a resource and the resource on the
  130. * server does not match the condition. E.g., conflicting
  131. * read-modify-write on the same resource.
  132. */
  133. FAILED_PRECONDITION: 9,
  134. /**
  135. * The operation was aborted, typically due to a concurrency issue
  136. * like sequencer check failures, transaction aborts, etc.
  137. *
  138. * See litmus test above for deciding between FAILED_PRECONDITION,
  139. * ABORTED, and UNAVAILABLE.
  140. */
  141. ABORTED: 10,
  142. /**
  143. * Operation was attempted past the valid range. E.g., seeking or
  144. * reading past end of file.
  145. *
  146. * Unlike INVALID_ARGUMENT, this error indicates a problem that may
  147. * be fixed if the system state changes. For example, a 32-bit file
  148. * system will generate INVALID_ARGUMENT if asked to read at an
  149. * offset that is not in the range [0,2^32-1], but it will generate
  150. * OUT_OF_RANGE if asked to read from an offset past the current
  151. * file size.
  152. *
  153. * There is a fair bit of overlap between FAILED_PRECONDITION and
  154. * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific
  155. * error) when it applies so that callers who are iterating through
  156. * a space can easily look for an OUT_OF_RANGE error to detect when
  157. * they are done.
  158. */
  159. OUT_OF_RANGE: 11,
  160. /** Operation is not implemented or not supported/enabled in this service. */
  161. UNIMPLEMENTED: 12,
  162. /**
  163. * Internal errors. Means some invariants expected by underlying
  164. * system has been broken. If you see one of these errors,
  165. * something is very broken.
  166. */
  167. INTERNAL: 13,
  168. /**
  169. * The service is currently unavailable. This is a most likely a
  170. * transient condition and may be corrected by retrying with
  171. * a backoff.
  172. *
  173. * See litmus test above for deciding between FAILED_PRECONDITION,
  174. * ABORTED, and UNAVAILABLE. */
  175. UNAVAILABLE: 14,
  176. /** Unrecoverable data loss or corruption. */
  177. DATA_LOSS: 15,
  178. /**
  179. * The request does not have valid authentication credentials for the
  180. * operation.
  181. */
  182. UNAUTHENTICATED: 16
  183. };
  184. /* The comments about propagation bit flags are copied rom
  185. * include/grpc/impl/codegen/propagation_bits.h for the purpose of including
  186. * them in generated documentation.
  187. */
  188. /**
  189. * Propagation flags: these can be bitwise or-ed to form the propagation option
  190. * for calls.
  191. *
  192. * Users are encouraged to write propagation masks as deltas from the default.
  193. * i.e. write `grpc.propagate.DEFAULTS &amp; ~grpc.propagate.DEADLINE` to disable
  194. * deadline propagation.
  195. * @memberof grpc
  196. * @alias grpc.propagate
  197. * @enum {number}
  198. */
  199. exports.propagate = {
  200. DEADLINE: 1,
  201. CENSUS_STATS_CONTEXT: 2,
  202. CENSUS_TRACING_CONTEXT: 4,
  203. CANCELLATION: 8,
  204. DEFAULTS: 65535
  205. };
  206. /* Many of the following comments are copied from
  207. * include/grpc/impl/codegen/grpc_types.h
  208. */
  209. /**
  210. * Call error constants. Call errors almost always indicate bugs in the gRPC
  211. * library, and these error codes are mainly useful for finding those bugs.
  212. * @memberof grpc
  213. * @readonly
  214. * @enum {number}
  215. */
  216. const callError = {
  217. OK: 0,
  218. ERROR: 1,
  219. NOT_ON_SERVER: 2,
  220. NOT_ON_CLIENT: 3,
  221. ALREADY_INVOKED: 5,
  222. NOT_INVOKED: 6,
  223. ALREADY_FINISHED: 7,
  224. TOO_MANY_OPERATIONS: 8,
  225. INVALID_FLAGS: 9,
  226. INVALID_METADATA: 10,
  227. INVALID_MESSAGE: 11,
  228. NOT_SERVER_COMPLETION_QUEUE: 12,
  229. BATCH_TOO_BIG: 13,
  230. PAYLOAD_TYPE_MISMATCH: 14
  231. };
  232. exports.callError = callError;
  233. /**
  234. * Write flags: these can be bitwise or-ed to form write options that modify
  235. * how data is written.
  236. * @memberof grpc
  237. * @alias grpc.writeFlags
  238. * @readonly
  239. * @enum {number}
  240. */
  241. exports.writeFlags = {
  242. /**
  243. * Hint that the write may be buffered and need not go out on the wire
  244. * immediately. GRPC is free to buffer the message until the next non-buffered
  245. * write, or until writes_done, but it need not buffer completely or at all.
  246. */
  247. BUFFER_HINT: 1,
  248. /**
  249. * Force compression to be disabled for a particular write
  250. */
  251. NO_COMPRESS: 2
  252. };
  253. /**
  254. * @memberof grpc
  255. * @alias grpc.logVerbosity
  256. * @readonly
  257. * @enum {number}
  258. */
  259. exports.logVerbosity = {
  260. DEBUG: 0,
  261. INFO: 1,
  262. ERROR: 2
  263. };
  264. </code></pre>
  265. </article>
  266. </section>
  267. </div>
  268. <nav>
  269. <h2><a href="index.html">Home</a></h2><h3>Externals</h3><ul><li><a href="external-Duplex.html">Duplex</a></li><li><a href="external-EventEmitter.html">EventEmitter</a></li><li><a href="external-GoogleCredential.html">GoogleCredential</a></li><li><a href="external-Readable.html">Readable</a></li><li><a href="external-Writable.html">Writable</a></li></ul><h3>Classes</h3><ul><li><a href="grpc.Client.html">Client</a></li><li><a href="grpc.credentials-CallCredentials.html">CallCredentials</a></li><li><a href="grpc.credentials-ChannelCredentials.html">ChannelCredentials</a></li><li><a href="grpc.Metadata.html">Metadata</a></li><li><a href="grpc.Server.html">Server</a></li><li><a href="grpc.ServerCredentials.html">ServerCredentials</a></li><li><a href="grpc-ClientDuplexStream.html">ClientDuplexStream</a></li><li><a href="grpc-ClientReadableStream.html">ClientReadableStream</a></li><li><a href="grpc-ClientUnaryCall.html">ClientUnaryCall</a></li><li><a href="grpc-ClientWritableStream.html">ClientWritableStream</a></li><li><a href="grpc-ServerDuplexStream.html">ServerDuplexStream</a></li><li><a href="grpc-ServerReadableStream.html">ServerReadableStream</a></li><li><a href="grpc-ServerUnaryCall.html">ServerUnaryCall</a></li><li><a href="grpc-ServerWritableStream.html">ServerWritableStream</a></li></ul><h3>Events</h3><ul><li><a href="grpc-ClientDuplexStream.html#event:metadata">metadata</a></li><li><a href="grpc-ClientDuplexStream.html#event:status">status</a></li><li><a href="grpc-ClientReadableStream.html#event:metadata">metadata</a></li><li><a href="grpc-ClientReadableStream.html#event:status">status</a></li><li><a href="grpc-ClientUnaryCall.html#event:metadata">metadata</a></li><li><a href="grpc-ClientUnaryCall.html#event:status">status</a></li><li><a href="grpc-ClientWritableStream.html#event:metadata">metadata</a></li><li><a href="grpc-ClientWritableStream.html#event:status">status</a></li><li><a href="grpc-ServerDuplexStream.html#~event:cancelled">cancelled</a></li><li><a href="grpc-ServerReadableStream.html#~event:cancelled">cancelled</a></li><li><a href="grpc-ServerUnaryCall.html#~event:cancelled">cancelled</a></li><li><a href="grpc-ServerWritableStream.html#~event:cancelled">cancelled</a></li></ul><h3>Namespaces</h3><ul><li><a href="grpc.html">grpc</a></li><li><a href="grpc.credentials.html">credentials</a></li></ul>
  270. </nav>
  271. <br class="clear">
  272. <footer>
  273. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed Jun 28 2017 09:44:06 GMT-0700 (PDT)
  274. </footer>
  275. <script> prettyPrint(); </script>
  276. <script src="scripts/linenumber.js"> </script>
  277. </body>
  278. </html>