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> |