1 |
|
2 | import { SrvRecord } from "dns";
|
3 | export declare type NodeKey = string;
|
4 | export declare type NodeRole = "master" | "slave" | "all";
|
5 | export interface RedisOptions {
|
6 | port: number;
|
7 | host: string;
|
8 | username?: string;
|
9 | password?: string;
|
10 | [key: string]: any;
|
11 | }
|
12 | export interface SrvRecordsGroup {
|
13 | totalWeight: number;
|
14 | records: SrvRecord[];
|
15 | }
|
16 | export interface GroupedSrvRecords {
|
17 | [key: number]: SrvRecordsGroup;
|
18 | }
|
19 | export declare function getNodeKey(node: RedisOptions): NodeKey;
|
20 | export declare function nodeKeyToRedisOptions(nodeKey: NodeKey): RedisOptions;
|
21 | export declare function normalizeNodeOptions(nodes: Array<string | number | object>): RedisOptions[];
|
22 | export declare function getUniqueHostnamesFromOptions(nodes: RedisOptions[]): string[];
|
23 | export declare function groupSrvRecords(records: SrvRecord[]): GroupedSrvRecords;
|
24 | export declare function weightSrvRecords(recordsGroup: SrvRecordsGroup): SrvRecord;
|
25 | export declare function getConnectionName(component: any, nodeConnectionName: any): string;
|