IDiscovery

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.

Methods

Register

Registers connection parameters into the discovery service.

Register(context IContext, key string, connection *ConnectionParams) (result *ConnectionParams, err error)

  • context: stringIContext - (optional) a context to trace execution through a call chain.
  • key: string - key to uniquely identify the connection parameters.
  • connection: *ConnectionParams - connection to be registered.
  • returns: (result *ConnectionParams, err error) - registered connection parameters.

ResolveAll

Resolves all connection parameters by their key.

ResolveAll(context IContext, key string) (result []*ConnectionParams, err error)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • key: string - key to uniquely identify the connections.
  • returns: (result []*ConnectionParams, err error) - list with resolved connections.

ResolveOne

Resolves a single connection parameters by its key.

ResolveOne(context IContext, key string) (result *ConnectionParams, err error)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • key: string - key used to uniquely identify the connection.
  • returns: (result *ConnectionParams, err error) - resolved connection.