UNPKG

coddyger

Version:

Coddyger est une bibliothèque JavaScript/TypeScript qui fournit des fonctions communes et des plugins pour la gestion des données, la communication entre services, et des utilitaires avancés pour le développement d'applications.

45 lines (44 loc) 1.12 kB
interface TopicInterface { id: string; set?: new () => DAO; handlers?: { [key: string]: (data: any) => Promise<void>; }; } interface DAO { remove: (query: { _id: string; }) => Promise<{ error?: any; }>; exist: (query: { _id: string; }) => Promise<boolean | { error: any; }>; save: (data: any) => Promise<{ error?: any; }>; update: (query: { _id: string; }, data: any) => Promise<{ error?: any; }>; } export declare class TransporterService { topics: TopicInterface[]; private isConnected; private reconnectAttempts; private readonly MAX_RECONNECT_ATTEMPTS; constructor(topics?: TopicInterface[]); private readonly kafka; readonly producer: import("kafkajs").Producer; readonly consumer: import("kafkajs").Consumer; send(value: string, topic?: string): Promise<void>; connect(): Promise<void>; disconnect(): Promise<void>; private handleReconnect; handleEvent(data: any, topic: TopicInterface): Promise<void>; get(): Promise<void>; } export {};