UNPKG

2.18 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright 2019 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 */
18Object.defineProperty(exports, "__esModule", { value: true });
19exports.channelOptionsEqual = exports.recognizedOptions = void 0;
20/**
21 * This is for checking provided options at runtime. This is an object for
22 * easier membership checking.
23 */
24exports.recognizedOptions = {
25 'grpc.ssl_target_name_override': true,
26 'grpc.primary_user_agent': true,
27 'grpc.secondary_user_agent': true,
28 'grpc.default_authority': true,
29 'grpc.keepalive_time_ms': true,
30 'grpc.keepalive_timeout_ms': true,
31 'grpc.keepalive_permit_without_calls': true,
32 'grpc.service_config': true,
33 'grpc.max_concurrent_streams': true,
34 'grpc.initial_reconnect_backoff_ms': true,
35 'grpc.max_reconnect_backoff_ms': true,
36 'grpc.use_local_subchannel_pool': true,
37 'grpc.max_send_message_length': true,
38 'grpc.max_receive_message_length': true,
39 'grpc.enable_http_proxy': true,
40 'grpc.enable_channelz': true,
41 'grpc.dns_min_time_between_resolutions_ms': true,
42 'grpc-node.max_session_memory': true,
43};
44function channelOptionsEqual(options1, options2) {
45 const keys1 = Object.keys(options1).sort();
46 const keys2 = Object.keys(options2).sort();
47 if (keys1.length !== keys2.length) {
48 return false;
49 }
50 for (let i = 0; i < keys1.length; i += 1) {
51 if (keys1[i] !== keys2[i]) {
52 return false;
53 }
54 if (options1[keys1[i]] !== options2[keys2[i]]) {
55 return false;
56 }
57 }
58 return true;
59}
60exports.channelOptionsEqual = channelOptionsEqual;
61//# sourceMappingURL=channel-options.js.map
\No newline at end of file