mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-30 21:30:16 +00:00 
			
		
		
		
	Level sets dependency graph to consume etcd 3.1.5
This commit is contained in:
		
							
								
								
									
										27
									
								
								vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| // Copyright 2016 Michal Witkowski. All Rights Reserved. | ||||
| // See LICENSE for licensing terms. | ||||
|  | ||||
| package grpc_prometheus | ||||
|  | ||||
| import ( | ||||
| 	"strings" | ||||
|  | ||||
| 	"google.golang.org/grpc/codes" | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| 	allCodes = []codes.Code{ | ||||
| 		codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound, | ||||
| 		codes.AlreadyExists, codes.PermissionDenied, codes.Unauthenticated, codes.ResourceExhausted, | ||||
| 		codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.Unimplemented, codes.Internal, | ||||
| 		codes.Unavailable, codes.DataLoss, | ||||
| 	} | ||||
| ) | ||||
|  | ||||
| func splitMethodName(fullMethodName string) (string, string) { | ||||
| 	fullMethodName = strings.TrimPrefix(fullMethodName, "/") // remove leading slash | ||||
| 	if i := strings.Index(fullMethodName, "/"); i >= 0 { | ||||
| 		return fullMethodName[:i], fullMethodName[i+1:] | ||||
| 	} | ||||
| 	return "unknown", "unknown" | ||||
| } | ||||
		Reference in New Issue
	
	Block a user