UNPKG

1.65 kBPlain TextView Raw
1/*
2 * Copyright 2019 gRPC authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18export enum Status {
19 OK = 0,
20 CANCELLED,
21 UNKNOWN,
22 INVALID_ARGUMENT,
23 DEADLINE_EXCEEDED,
24 NOT_FOUND,
25 ALREADY_EXISTS,
26 PERMISSION_DENIED,
27 RESOURCE_EXHAUSTED,
28 FAILED_PRECONDITION,
29 ABORTED,
30 OUT_OF_RANGE,
31 UNIMPLEMENTED,
32 INTERNAL,
33 UNAVAILABLE,
34 DATA_LOSS,
35 UNAUTHENTICATED,
36}
37
38export enum LogVerbosity {
39 DEBUG = 0,
40 INFO,
41 ERROR,
42 NONE,
43}
44
45/**
46 * NOTE: This enum is not currently used in any implemented API in this
47 * library. It is included only for type parity with the other implementation.
48 */
49export enum Propagate {
50 DEADLINE = 1,
51 CENSUS_STATS_CONTEXT = 2,
52 CENSUS_TRACING_CONTEXT = 4,
53 CANCELLATION = 8,
54 // https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/propagation_bits.h#L43
55 DEFAULTS = 0xffff |
56 Propagate.DEADLINE |
57 Propagate.CENSUS_STATS_CONTEXT |
58 Propagate.CENSUS_TRACING_CONTEXT |
59 Propagate.CANCELLATION,
60}
61
62// -1 means unlimited
63export const DEFAULT_MAX_SEND_MESSAGE_LENGTH = -1;
64
65// 4 MB default
66export const DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024;