src_constants.js.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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 gRPC authors.
  22. *
  23. * Licensed under the Apache License, Version 2.0 (the "License");
  24. * you may not use this file except in compliance with the License.
  25. * You may obtain a copy of the License at
  26. *
  27. * http://www.apache.org/licenses/LICENSE-2.0
  28. *
  29. * Unless required by applicable law or agreed to in writing, software
  30. * distributed under the License is distributed on an "AS IS" BASIS,
  31. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  32. * See the License for the specific language governing permissions and
  33. * limitations under the License.
  34. *
  35. */
  36. /* The comments about status codes are copied verbatim (with some formatting
  37. * modifications) from include/grpc/impl/codegen/status.h, for the purpose of
  38. * including them in generated documentation.
  39. */
  40. /**
  41. * Enum of status codes that gRPC can return
  42. * @memberof grpc
  43. * @alias grpc.status
  44. * @readonly
  45. * @enum {number}
  46. */
  47. exports.status = {
  48. /** Not an error; returned on success */
  49. OK: 0,
  50. /** The operation was cancelled (typically by the caller). */
  51. CANCELLED: 1,
  52. /**
  53. * Unknown error. An example of where this error may be returned is
  54. * if a status value received from another address space belongs to
  55. * an error-space that is not known in this address space. Also
  56. * errors raised by APIs that do not return enough error information
  57. * may be converted to this error.
  58. */
  59. UNKNOWN: 2,
  60. /**
  61. * Client specified an invalid argument. Note that this differs
  62. * from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments
  63. * that are problematic regardless of the state of the system
  64. * (e.g., a malformed file name).
  65. */
  66. INVALID_ARGUMENT: 3,
  67. /**
  68. * Deadline expired before operation could complete. For operations
  69. * that change the state of the system, this error may be returned
  70. * even if the operation has completed successfully. For example, a
  71. * successful response from a server could have been delayed long
  72. * enough for the deadline to expire.
  73. */
  74. DEADLINE_EXCEEDED: 4,
  75. /** Some requested entity (e.g., file or directory) was not found. */
  76. NOT_FOUND: 5,
  77. /**
  78. * Some entity that we attempted to create (e.g., file or directory)
  79. * already exists.
  80. */
  81. ALREADY_EXISTS: 6,
  82. /**
  83. * The caller does not have permission to execute the specified
  84. * operation. PERMISSION_DENIED must not be used for rejections
  85. * caused by exhausting some resource (use RESOURCE_EXHAUSTED
  86. * instead for those errors). PERMISSION_DENIED must not be
  87. * used if the caller can not be identified (use UNAUTHENTICATED
  88. * instead for those errors).
  89. */
  90. PERMISSION_DENIED: 7,
  91. /**
  92. * Some resource has been exhausted, perhaps a per-user quota, or
  93. * perhaps the entire file system is out of space.
  94. */
  95. RESOURCE_EXHAUSTED: 8,
  96. /**
  97. * Operation was rejected because the system is not in a state
  98. * required for the operation's execution. For example, directory
  99. * to be deleted may be non-empty, an rmdir operation is applied to
  100. * a non-directory, etc.
  101. *
  102. * A litmus test that may help a service implementor in deciding
  103. * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
  104. *
  105. * - Use UNAVAILABLE if the client can retry just the failing call.
  106. * - Use ABORTED if the client should retry at a higher-level
  107. * (e.g., restarting a read-modify-write sequence).
  108. * - Use FAILED_PRECONDITION if the client should not retry until
  109. * the system state has been explicitly fixed. E.g., if an "rmdir"
  110. * fails because the directory is non-empty, FAILED_PRECONDITION
  111. * should be returned since the client should not retry unless
  112. * they have first fixed up the directory by deleting files from it.
  113. * - Use FAILED_PRECONDITION if the client performs conditional
  114. * REST Get/Update/Delete on a resource and the resource on the
  115. * server does not match the condition. E.g., conflicting
  116. * read-modify-write on the same resource.
  117. */
  118. FAILED_PRECONDITION: 9,
  119. /**
  120. * The operation was aborted, typically due to a concurrency issue
  121. * like sequencer check failures, transaction aborts, etc.
  122. *
  123. * See litmus test above for deciding between FAILED_PRECONDITION,
  124. * ABORTED, and UNAVAILABLE.
  125. */
  126. ABORTED: 10,
  127. /**
  128. * Operation was attempted past the valid range. E.g., seeking or
  129. * reading past end of file.
  130. *
  131. * Unlike INVALID_ARGUMENT, this error indicates a problem that may
  132. * be fixed if the system state changes. For example, a 32-bit file
  133. * system will generate INVALID_ARGUMENT if asked to read at an
  134. * offset that is not in the range [0,2^32-1], but it will generate
  135. * OUT_OF_RANGE if asked to read from an offset past the current
  136. * file size.
  137. *
  138. * There is a fair bit of overlap between FAILED_PRECONDITION and
  139. * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific
  140. * error) when it applies so that callers who are iterating through
  141. * a space can easily look for an OUT_OF_RANGE error to detect when
  142. * they are done.
  143. */
  144. OUT_OF_RANGE: 11,
  145. /** Operation is not implemented or not supported/enabled in this service. */
  146. UNIMPLEMENTED: 12,
  147. /**
  148. * Internal errors. Means some invariants expected by underlying
  149. * system has been broken. If you see one of these errors,
  150. * something is very broken.
  151. */
  152. INTERNAL: 13,
  153. /**
  154. * The service is currently unavailable. This is a most likely a
  155. * transient condition and may be corrected by retrying with
  156. * a backoff.
  157. *
  158. * See litmus test above for deciding between FAILED_PRECONDITION,
  159. * ABORTED, and UNAVAILABLE. */
  160. UNAVAILABLE: 14,
  161. /** Unrecoverable data loss or corruption. */
  162. DATA_LOSS: 15,
  163. /**
  164. * The request does not have valid authentication credentials for the
  165. * operation.
  166. */
  167. UNAUTHENTICATED: 16
  168. };
  169. /* The comments about propagation bit flags are copied rom
  170. * include/grpc/impl/codegen/propagation_bits.h for the purpose of including
  171. * them in generated documentation.
  172. */
  173. /**
  174. * Propagation flags: these can be bitwise or-ed to form the propagation option
  175. * for calls.
  176. *
  177. * Users are encouraged to write propagation masks as deltas from the default.
  178. * i.e. write `grpc.propagate.DEFAULTS &amp; ~grpc.propagate.DEADLINE` to disable
  179. * deadline propagation.
  180. * @memberof grpc
  181. * @alias grpc.propagate
  182. * @enum {number}
  183. */
  184. exports.propagate = {
  185. DEADLINE: 1,
  186. CENSUS_STATS_CONTEXT: 2,
  187. CENSUS_TRACING_CONTEXT: 4,
  188. CANCELLATION: 8,
  189. DEFAULTS: 65535
  190. };
  191. /* Many of the following comments are copied from
  192. * include/grpc/impl/codegen/grpc_types.h
  193. */
  194. /**
  195. * Call error constants. Call errors almost always indicate bugs in the gRPC
  196. * library, and these error codes are mainly useful for finding those bugs.
  197. * @memberof grpc
  198. * @readonly
  199. * @enum {number}
  200. */
  201. const callError = {
  202. OK: 0,
  203. ERROR: 1,
  204. NOT_ON_SERVER: 2,
  205. NOT_ON_CLIENT: 3,
  206. ALREADY_INVOKED: 5,
  207. NOT_INVOKED: 6,
  208. ALREADY_FINISHED: 7,
  209. TOO_MANY_OPERATIONS: 8,
  210. INVALID_FLAGS: 9,
  211. INVALID_METADATA: 10,
  212. INVALID_MESSAGE: 11,
  213. NOT_SERVER_COMPLETION_QUEUE: 12,
  214. BATCH_TOO_BIG: 13,
  215. PAYLOAD_TYPE_MISMATCH: 14
  216. };
  217. exports.callError = callError;
  218. /**
  219. * Write flags: these can be bitwise or-ed to form write options that modify
  220. * how data is written.
  221. * @memberof grpc
  222. * @alias grpc.writeFlags
  223. * @readonly
  224. * @enum {number}
  225. */
  226. exports.writeFlags = {
  227. /**
  228. * Hint that the write may be buffered and need not go out on the wire
  229. * immediately. GRPC is free to buffer the message until the next non-buffered
  230. * write, or until writes_done, but it need not buffer completely or at all.
  231. */
  232. BUFFER_HINT: 1,
  233. /**
  234. * Force compression to be disabled for a particular write
  235. */
  236. NO_COMPRESS: 2
  237. };
  238. /**
  239. * @memberof grpc
  240. * @alias grpc.logVerbosity
  241. * @readonly
  242. * @enum {number}
  243. */
  244. exports.logVerbosity = {
  245. DEBUG: 0,
  246. INFO: 1,
  247. ERROR: 2
  248. };
  249. </code></pre>
  250. </article>
  251. </section>
  252. </div>
  253. <nav>
  254. <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>
  255. </nav>
  256. <br class="clear">
  257. <footer>
  258. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Fri Sep 08 2017 11:10:31 GMT-0700 (PDT)
  259. </footer>
  260. <script> prettyPrint(); </script>
  261. <script src="scripts/linenumber.js"> </script>
  262. </body>
  263. </html>