Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: server/static/rpc/rpc-code.html

Issue 1695893004: RPC Explorer (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@rpcepxlorer-deps
Patch Set: 80 chars Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « server/static/rpc/rpc-client.html ('k') | server/static/rpc/rpc-error.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/static/rpc/rpc-code.html
diff --git a/server/static/rpc/rpc-code.html b/server/static/rpc/rpc-code.html
new file mode 100644
index 0000000000000000000000000000000000000000..bdc0218c6c5dca21c353c7c0ea890758cc3c8292
--- /dev/null
+++ b/server/static/rpc/rpc-code.html
@@ -0,0 +1,53 @@
+<!--
+ Copyright 2016 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file.
+ -->
+
+<script>
+ 'use strict';
+
+ var luci = (function(luci) {
+
+ var rpc = luci.rpc = luci.rpc || {};
+
+ /**
+ * gRPC response codes.
+ * based on https://github.com/grpc/grpc-go/blob/972dbd2/codes/codes.go#L43
+ * @enum {number}
+ */
+ rpc.Code = {
+ OK: 0,
+ CANCELED: 1,
+ UNKNOWN: 2,
+ INVALID_ARGUMENT: 3,
+ DEADLINE_EXCEEDED: 4,
+ NOT_FOUND: 5,
+ ALREADY_EXISTS: 6,
+ PERMISSION_DENIED: 7,
+ UNAUTHENTICATED: 16,
+ RESOURCE_EXHAUSTED: 8,
+ FAILED_PRECONDITION: 9,
+ ABORTED: 10,
+ OUT_OF_RANGE: 11,
+ UNIMPLEMENTED: 12,
+ INTERNAL: 13,
+ UNAVAILABLE: 14,
+ DATA_LOSS: 15
+ };
+
+ var codeNames = {};
+ for (var name in rpc.Code) {
+ codeNames[rpc.Code[name]] = name;
+ }
+
+ /**
+ * Returns response code name or undefined.
+ */
+ rpc.CodeName = function(code) {
+ return codeNames[code];
+ };
+
+ return luci;
+ }(luci || {}));
+</script>
« no previous file with comments | « server/static/rpc/rpc-client.html ('k') | server/static/rpc/rpc-error.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698