Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/grpclib/const.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import enum
2import collections
5@enum.unique
6class Status(enum.Enum):
7 """Predefined gRPC status codes represented as enum
9 See also: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
10 """
11 #: The operation completed successfully
12 OK = 0
13 #: The operation was cancelled (typically by the caller)
14 CANCELLED = 1
15 #: Generic status to describe error when it can't be described using
16 #: other statuses
17 UNKNOWN = 2
18 #: Client specified an invalid argument
19 INVALID_ARGUMENT = 3
20 #: Deadline expired before operation could complete
21 DEADLINE_EXCEEDED = 4
22 #: Some requested entity was not found
23 NOT_FOUND = 5
24 #: Some entity that we attempted to create already exists
25 ALREADY_EXISTS = 6
26 #: The caller does not have permission to execute the specified operation
27 PERMISSION_DENIED = 7
28 #: Some resource has been exhausted, perhaps a per-user quota, or perhaps
29 #: the entire file system is out of space
30 RESOURCE_EXHAUSTED = 8
31 #: Operation was rejected because the system is not in a state required
32 #: for the operation's execution
33 FAILED_PRECONDITION = 9
34 #: The operation was aborted
35 ABORTED = 10
36 #: Operation was attempted past the valid range
37 OUT_OF_RANGE = 11
38 #: Operation is not implemented or not supported/enabled in this service
39 UNIMPLEMENTED = 12
40 #: Internal errors
41 INTERNAL = 13
42 #: The service is currently unavailable
43 UNAVAILABLE = 14
44 #: Unrecoverable data loss or corruption
45 DATA_LOSS = 15
46 #: The request does not have valid authentication credentials for the
47 #: operation
48 UNAUTHENTICATED = 16
51_Cardinality = collections.namedtuple(
52 '_Cardinality', 'client_streaming, server_streaming',
53)
56@enum.unique
57class Cardinality(_Cardinality, enum.Enum):
58 UNARY_UNARY = _Cardinality(False, False)
59 UNARY_STREAM = _Cardinality(False, True)
60 STREAM_UNARY = _Cardinality(True, False)
61 STREAM_STREAM = _Cardinality(True, True)
64Handler = collections.namedtuple(
65 'Handler', 'func, cardinality, request_type, reply_type',
66)