1 | import { Status } from './constants';
|
2 | import { Duration } from './duration';
|
3 | import { LoadBalancingConfig } from './load-balancer';
|
4 | export interface MethodConfigName {
|
5 | service?: string;
|
6 | method?: string;
|
7 | }
|
8 | export interface RetryPolicy {
|
9 | maxAttempts: number;
|
10 | initialBackoff: string;
|
11 | maxBackoff: string;
|
12 | backoffMultiplier: number;
|
13 | retryableStatusCodes: (Status | string)[];
|
14 | }
|
15 | export interface HedgingPolicy {
|
16 | maxAttempts: number;
|
17 | hedgingDelay?: string;
|
18 | nonFatalStatusCodes?: (Status | string)[];
|
19 | }
|
20 | export interface MethodConfig {
|
21 | name: MethodConfigName[];
|
22 | waitForReady?: boolean;
|
23 | timeout?: Duration;
|
24 | maxRequestBytes?: number;
|
25 | maxResponseBytes?: number;
|
26 | retryPolicy?: RetryPolicy;
|
27 | hedgingPolicy?: HedgingPolicy;
|
28 | }
|
29 | export interface RetryThrottling {
|
30 | maxTokens: number;
|
31 | tokenRatio: number;
|
32 | }
|
33 | export interface ServiceConfig {
|
34 | loadBalancingPolicy?: string;
|
35 | loadBalancingConfig: LoadBalancingConfig[];
|
36 | methodConfig: MethodConfig[];
|
37 | retryThrottling?: RetryThrottling;
|
38 | }
|
39 | export interface ServiceConfigCanaryConfig {
|
40 | clientLanguage?: string[];
|
41 | percentage?: number;
|
42 | clientHostname?: string[];
|
43 | serviceConfig: ServiceConfig;
|
44 | }
|
45 | export declare function validateRetryThrottling(obj: any): RetryThrottling;
|
46 | export declare function validateServiceConfig(obj: any): ServiceConfig;
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export declare function extractAndSelectServiceConfig(txtRecord: string[][], percentage: number): ServiceConfig | null;
|