1 | import { ChannelOptions } from './channel-options';
|
2 | import { Endpoint, SubchannelAddress } from './subchannel-address';
|
3 | import { ConnectivityState } from './connectivity-state';
|
4 | import { Picker } from './picker';
|
5 | import type { ChannelRef, SubchannelRef } from './channelz';
|
6 | import { SubchannelInterface } from './subchannel-interface';
|
7 | import { LoadBalancingConfig } from './service-config';
|
8 | import { ChannelCredentials } from './channel-credentials';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface ChannelControlHelper {
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 | createSubchannel(subchannelAddress: SubchannelAddress, subchannelArgs: ChannelOptions, credentialsOverride: ChannelCredentials | null): SubchannelInterface;
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | updateState(connectivityState: ConnectivityState, picker: Picker): void;
|
28 | |
29 |
|
30 |
|
31 | requestReresolution(): void;
|
32 | addChannelzChild(child: ChannelRef | SubchannelRef): void;
|
33 | removeChannelzChild(child: ChannelRef | SubchannelRef): void;
|
34 | }
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare function createChildChannelControlHelper(parent: ChannelControlHelper, overrides: Partial<ChannelControlHelper>): ChannelControlHelper;
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | export interface LoadBalancer {
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | updateAddressList(endpointList: Endpoint[], lbConfig: TypedLoadBalancingConfig, attributes: {
|
59 | [key: string]: unknown;
|
60 | }): void;
|
61 | |
62 |
|
63 |
|
64 | exitIdle(): void;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 | resetBackoff(): void;
|
71 | |
72 |
|
73 |
|
74 |
|
75 | destroy(): void;
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 | getTypeName(): string;
|
82 | }
|
83 | export interface LoadBalancerConstructor {
|
84 | new (channelControlHelper: ChannelControlHelper, credentials: ChannelCredentials, options: ChannelOptions): LoadBalancer;
|
85 | }
|
86 | export interface TypedLoadBalancingConfig {
|
87 | getLoadBalancerName(): string;
|
88 | toJsonObject(): object;
|
89 | }
|
90 | export interface TypedLoadBalancingConfigConstructor {
|
91 | new (...args: any): TypedLoadBalancingConfig;
|
92 | createFromJson(obj: any): TypedLoadBalancingConfig;
|
93 | }
|
94 | export declare function registerLoadBalancerType(typeName: string, loadBalancerType: LoadBalancerConstructor, loadBalancingConfigType: TypedLoadBalancingConfigConstructor): void;
|
95 | export declare function registerDefaultLoadBalancerType(typeName: string): void;
|
96 | export declare function createLoadBalancer(config: TypedLoadBalancingConfig, channelControlHelper: ChannelControlHelper, credentials: ChannelCredentials, options: ChannelOptions): LoadBalancer | null;
|
97 | export declare function isLoadBalancerNameRegistered(typeName: string): boolean;
|
98 | export declare function parseLoadBalancingConfig(rawConfig: LoadBalancingConfig): TypedLoadBalancingConfig;
|
99 | export declare function getDefaultConfig(): TypedLoadBalancingConfig;
|
100 | export declare function selectLbConfigFromList(configs: LoadBalancingConfig[], fallbackTodefault?: boolean): TypedLoadBalancingConfig | null;
|