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

Unified Diff: server/static/rpcexplorer/rpc-codes.html

Issue 1695893004: RPC Explorer (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@rpcepxlorer-deps
Patch Set: 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
Index: server/static/rpcexplorer/rpc-codes.html
diff --git a/server/static/rpcexplorer/rpc-codes.html b/server/static/rpcexplorer/rpc-codes.html
new file mode 100644
index 0000000000000000000000000000000000000000..c6da026cc6a406b7ec7a611503d14db3aa5037f5
--- /dev/null
+++ b/server/static/rpcexplorer/rpc-codes.html
@@ -0,0 +1,44 @@
+<!--
+ ~ // 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 rpcExplorer = (function(rpcExplorer) {
+
+ // Based on https://github.com/grpc/grpc-go/blob/972dbd2/codes/codes.go#L43
+ rpcExplorer.Codes = {
Bons 2016/02/13 17:18:25 JS enum naming convention is typically rpcExplore
nodir 2016/02/17 02:02:12 Done.
+ OK: 0,
+ Canceled: 1,
+ Unknown: 2,
+ InvalidArgument: 3,
+ DeadlineExceeded: 4,
+ NotFound: 5,
+ AlreadyExists: 6,
+ PermissionDenied: 7,
+ Unauthenticated: 16,
+ ResourceExhausted: 8,
+ FailedPrecondition: 9,
+ Aborted: 10,
+ OutOfRange: 11,
+ Unimplemented: 12,
+ Internal: 13,
+ Unavailable: 14,
+ DataLoss: 15
+ };
+
+ var codeNames = {};
+ for (var name in rpcExplorer.Codes) {
+ codeNames[rpcExplorer.Codes[name]] = name;
+ }
+ rpcExplorer.CodeName = function(code) {
+ return codeNames[code];
+ };
+
+ return rpcExplorer;
+}(rpcExplorer || {}));
+</script>

Powered by Google App Engine
This is Rietveld 408576698