diff options
Diffstat (limited to 'vendor/google.golang.org/grpc/codes/code_string.go')
-rw-r--r-- | vendor/google.golang.org/grpc/codes/code_string.go | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/vendor/google.golang.org/grpc/codes/code_string.go b/vendor/google.golang.org/grpc/codes/code_string.go index e6762d0..0b206a5 100644 --- a/vendor/google.golang.org/grpc/codes/code_string.go +++ b/vendor/google.golang.org/grpc/codes/code_string.go | |||
@@ -1,16 +1,62 @@ | |||
1 | // generated by stringer -type=Code; DO NOT EDIT | 1 | /* |
2 | * | ||
3 | * Copyright 2017 gRPC authors. | ||
4 | * | ||
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | * you may not use this file except in compliance with the License. | ||
7 | * You may obtain a copy of the License at | ||
8 | * | ||
9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | * | ||
11 | * Unless required by applicable law or agreed to in writing, software | ||
12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | * See the License for the specific language governing permissions and | ||
15 | * limitations under the License. | ||
16 | * | ||
17 | */ | ||
2 | 18 | ||
3 | package codes | 19 | package codes |
4 | 20 | ||
5 | import "fmt" | 21 | import "strconv" |
6 | 22 | ||
7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" | 23 | func (c Code) String() string { |
8 | 24 | switch c { | |
9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} | 25 | case OK: |
10 | 26 | return "OK" | |
11 | func (i Code) String() string { | 27 | case Canceled: |
12 | if i+1 >= Code(len(_Code_index)) { | 28 | return "Canceled" |
13 | return fmt.Sprintf("Code(%d)", i) | 29 | case Unknown: |
30 | return "Unknown" | ||
31 | case InvalidArgument: | ||
32 | return "InvalidArgument" | ||
33 | case DeadlineExceeded: | ||
34 | return "DeadlineExceeded" | ||
35 | case NotFound: | ||
36 | return "NotFound" | ||
37 | case AlreadyExists: | ||
38 | return "AlreadyExists" | ||
39 | case PermissionDenied: | ||
40 | return "PermissionDenied" | ||
41 | case ResourceExhausted: | ||
42 | return "ResourceExhausted" | ||
43 | case FailedPrecondition: | ||
44 | return "FailedPrecondition" | ||
45 | case Aborted: | ||
46 | return "Aborted" | ||
47 | case OutOfRange: | ||
48 | return "OutOfRange" | ||
49 | case Unimplemented: | ||
50 | return "Unimplemented" | ||
51 | case Internal: | ||
52 | return "Internal" | ||
53 | case Unavailable: | ||
54 | return "Unavailable" | ||
55 | case DataLoss: | ||
56 | return "DataLoss" | ||
57 | case Unauthenticated: | ||
58 | return "Unauthenticated" | ||
59 | default: | ||
60 | return "Code(" + strconv.FormatInt(int64(c), 10) + ")" | ||
14 | } | 61 | } |
15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] | ||
16 | } | 62 | } |