Interface for discovery services which are used to store and resolve connection parameters to connect to external services.
Description
The IDiscovery interface is used to create discovery services which are used to store and resolve connection parameters used to connect to external services.
Instance methods
register
Registers connection parameters into the discovery service.
register(context: IContext, key: string, connection: ConnectionParams): Promise<ConnectionParams>
- context: IContext - (optional) a context to trace execution through call chain.
- key: string - a key to uniquely identify the connection parameters.
- connection: ConnectionParams - a connection to be registered.
- returns: Promise<ConnectionParams> - the registered connection parameters.
resolveAll
Resolves all connection parameters by their key.
resolveAll(context: IContext, key: string): Promise<ConnectionParams[]>
- context: IContext - (optional) a context to trace execution through call chain.
- key: string - a key to uniquely identify the connections.
- returns: Promise<ConnectionParams[]> - a list with resolved connections.
resolveOne
Resolves a single connection parameters by its key.
resolveOne(context: IContext, key: string): Promise<ConnectionParams>
- context: IContext - (optional) a context to trace execution through call chain.
- key: string - a key to uniquely identify the connection.
- returns: Promise<ConnectionParams> - a resolved connection.