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