Documentation ¶
Index ¶
- Constants
- Variables
- func NewDefaultDiscoveryFactory() *build.Factory
- type CompositeConnectionResolver
- func (c *CompositeConnectionResolver) Compose(correlationId string, connections []*ConnectionParams, ...) (options *config.ConfigParams, err error)
- func (c *CompositeConnectionResolver) ComposeOptions(connections []*ConnectionParams, credential *auth.CredentialParams, ...) *config.ConfigParams
- func (c *CompositeConnectionResolver) Configure(ctx context.Context, config *config.ConfigParams)
- func (c *CompositeConnectionResolver) FinalizeOptions(options *config.ConfigParams) *config.ConfigParams
- func (c *CompositeConnectionResolver) MergeConnection(options *config.ConfigParams, connection *ConnectionParams) *config.ConfigParams
- func (c *CompositeConnectionResolver) MergeCredential(options *config.ConfigParams, credential *auth.CredentialParams) *config.ConfigParams
- func (c *CompositeConnectionResolver) MergeOptional(options *config.ConfigParams, parameters *config.ConfigParams) *config.ConfigParams
- func (c *CompositeConnectionResolver) Resolve(correlationId string) (options *config.ConfigParams, err error)
- func (c *CompositeConnectionResolver) SetReferences(ctx context.Context, references refer.IReferences)
- func (c *CompositeConnectionResolver) ValidateConnection(correlationId string, connection *ConnectionParams) error
- func (c *CompositeConnectionResolver) ValidateCredential(correlationId string, credential *auth.CredentialParams) error
- type ConnectionParams
- func NewConnectionParams(values map[string]string) *ConnectionParams
- func NewConnectionParamsFromConfig(config *config.ConfigParams) *ConnectionParams
- func NewConnectionParamsFromMaps(maps ...map[string]string) *ConnectionParams
- func NewConnectionParamsFromString(line string) *ConnectionParams
- func NewConnectionParamsFromTuples(tuples ...any) *ConnectionParams
- func NewConnectionParamsFromTuplesArray(tuples []any) *ConnectionParams
- func NewConnectionParamsFromValue(value any) *ConnectionParams
- func NewEmptyConnectionParams() *ConnectionParams
- func NewManyConnectionParamsFromConfig(config *config.ConfigParams) []*ConnectionParams
- func (c *ConnectionParams) DiscoveryKey() string
- func (c *ConnectionParams) Host() string
- func (c *ConnectionParams) Port() int
- func (c *ConnectionParams) PortWithDefault(defaultValue int) int
- func (c *ConnectionParams) Protocol() string
- func (c *ConnectionParams) ProtocolWithDefault(defaultValue string) string
- func (c *ConnectionParams) SetDiscoveryKey(value string)
- func (c *ConnectionParams) SetHost(value string)
- func (c *ConnectionParams) SetPort(value int)
- func (c *ConnectionParams) SetProtocol(value string)
- func (c *ConnectionParams) SetUri(value string)
- func (c *ConnectionParams) Uri() string
- func (c *ConnectionParams) UseDiscovery() bool
- type ConnectionResolver
- func (c *ConnectionResolver) Add(connection *ConnectionParams)
- func (c *ConnectionResolver) Configure(ctx context.Context, config *config.ConfigParams)
- func (c *ConnectionResolver) GetAll() []*ConnectionParams
- func (c *ConnectionResolver) Register(correlationId string, connection *ConnectionParams) error
- func (c *ConnectionResolver) Resolve(correlationId string) (*ConnectionParams, error)
- func (c *ConnectionResolver) ResolveAll(correlationId string) ([]*ConnectionParams, error)
- func (c *ConnectionResolver) SetReferences(ctx context.Context, references refer.IReferences)
- type ICompositeConnectionResolverOverrides
- type IDiscovery
- type MemoryDiscovery
- func (c *MemoryDiscovery) Configure(ctx context.Context, config *config.ConfigParams)
- func (c *MemoryDiscovery) ReadConnections(config *config.ConfigParams)
- func (c *MemoryDiscovery) Register(correlationId string, key string, connection *ConnectionParams) (result *ConnectionParams, err error)
- func (c *MemoryDiscovery) ResolveAll(correlationId string, key string) (result []*ConnectionParams, err error)
- func (c *MemoryDiscovery) ResolveOne(correlationId string, key string) (result *ConnectionParams, err error)
Constants ¶
const ( SectionNameConnections = "connections" SectionNameConnection = "connection" ConnectionParamDiscoveryKey = "discovery_key" ConnectionParamProtocol = "protocol" ConnectionParamHost = "host" ConnectionParamIp = "ip" ConnectionParamPort = "port" ConnectionParamURI = "uri" ConnectionParamCluster = "cluster" )
const ConnectionSectionNameParameter = "connections"
Variables ¶
var ConnectionUtils = _TConnectionUtils{}
var MemoryDiscoveryDescriptor = refer.NewDescriptor("pip-services", "discovery", "memory", "*", "1.0")
MemoryDiscoveryDescriptor creates IDiscovery components by their descriptors.
Functions ¶
func NewDefaultDiscoveryFactory ¶
NewDefaultDiscoveryFactory create a new instance of the factory.
Returns: *build.Factory
Types ¶
type CompositeConnectionResolver ¶ added in v1.0.4
type CompositeConnectionResolver struct { Overrides ICompositeConnectionResolverOverrides // The connection options Options *config.ConfigParams // The connections resolver. ConnectionResolver *ConnectionResolver // The credentials resolver. CredentialResolver *auth.CredentialResolver // The cluster support (multiple connections) ClusterSupported bool // The default protocol DefaultProtocol string // The default port number DefaultPort int // The list of supported protocols SupportedProtocols []string }
CompositeConnectionResolver helper class that resolves connection and credential parameters, validates them and generates connection options.
Configuration parameters - connection(s): - discovery_key: (optional) a key to retrieve the connection from [IDiscovery]] - protocol: communication protocol - host: host name or IP address - port: port number - uri: resource URI or connection string with all parameters in it - credential(s): - store_key: (optional) a key to retrieve the credentials from [ICredentialStore]] - username: user name - password: user password References - *:discovery:*:*:1.0 (optional) [IDiscovery]] services to resolve connections - *:credential-store:*:*:1.0 (optional) Credential stores to resolve credentials
func InheritCompositeConnectionResolver ¶ added in v1.0.4
func InheritCompositeConnectionResolver(overrides ICompositeConnectionResolverOverrides) *CompositeConnectionResolver
InheritCompositeConnectionResolver creates new CompositeConnectionResolver
Parameters: - overrides a child reference with overrides for virtual methods return *CompositeConnectionResolver
func (*CompositeConnectionResolver) Compose ¶ added in v1.0.4
func (c *CompositeConnectionResolver) Compose(correlationId string, connections []*ConnectionParams, credential *auth.CredentialParams, parameters *config.ConfigParams) (options *config.ConfigParams, err error)
Compose Composite connection options from connection and credential parameters.
Parameters: - correlationId (optional) transaction id to trace execution through call chain. - connections connection parameters - credential parameters - parameters optional parameters Returns: resolved options or error.
func (*CompositeConnectionResolver) ComposeOptions ¶ added in v1.0.4
func (c *CompositeConnectionResolver) ComposeOptions(connections []*ConnectionParams, credential *auth.CredentialParams, parameters *config.ConfigParams) *config.ConfigParams
ComposeOptions composes connection and credential parameters into connection options. This method can be override in child classes.
Parameters: - connections a list of connection parameters - credential parameters - parameters optional parameters Returns: a composed connection options.
func (*CompositeConnectionResolver) Configure ¶ added in v1.0.4
func (c *CompositeConnectionResolver) Configure(ctx context.Context, config *config.ConfigParams)
Configure configures component by passing configuration parameters.
Parameters: - ctx context.Context - config configuration parameters to be set.
func (*CompositeConnectionResolver) FinalizeOptions ¶ added in v1.0.4
func (c *CompositeConnectionResolver) FinalizeOptions(options *config.ConfigParams) *config.ConfigParams
FinalizeOptions finalize merged options This method can be overriden in child classes.
Parameters: - options connection options Returns: finalized connection options
func (*CompositeConnectionResolver) MergeConnection ¶ added in v1.0.4
func (c *CompositeConnectionResolver) MergeConnection(options *config.ConfigParams, connection *ConnectionParams) *config.ConfigParams
MergeConnection merges connection options with connection parameters This method can be override in child classes.
Parameters: - options connection options - connection parameters to be merged Returns: merged connection options.
func (*CompositeConnectionResolver) MergeCredential ¶ added in v1.0.4
func (c *CompositeConnectionResolver) MergeCredential(options *config.ConfigParams, credential *auth.CredentialParams) *config.ConfigParams
MergeCredential merges connection options with credential parameters This method can be overriden in child classes.
Parameters: - options connection options - credential parameters to be merged Returns: merged connection options.
func (*CompositeConnectionResolver) MergeOptional ¶ added in v1.0.4
func (c *CompositeConnectionResolver) MergeOptional(options *config.ConfigParams, parameters *config.ConfigParams) *config.ConfigParams
MergeOptional merges connection options with optional parameters This method can be overriden in child classes.
Parameters: - options connection options - parameters optional parameters to be merged Returns merged connection options.
func (*CompositeConnectionResolver) Resolve ¶ added in v1.0.4
func (c *CompositeConnectionResolver) Resolve(correlationId string) (options *config.ConfigParams, err error)
Resolve connection options from connection and credential parameters.
- correlationId (optional) transaction id to trace execution through call chain.
- return resolved options or error.
func (*CompositeConnectionResolver) SetReferences ¶ added in v1.0.4
func (c *CompositeConnectionResolver) SetReferences(ctx context.Context, references refer.IReferences)
SetReferences sets references to dependent components.
Parameters: - ctx context.Context - references references to locate the component dependencies.
func (*CompositeConnectionResolver) ValidateConnection ¶ added in v1.0.4
func (c *CompositeConnectionResolver) ValidateConnection(correlationId string, connection *ConnectionParams) error
ValidateConnection validates connection parameters. This method can be override in child classes.
Parameters: - correlationId (optional) transaction id to trace execution through call chain. - connection parameters to be validated Returns: error or nil if validation was successful
func (*CompositeConnectionResolver) ValidateCredential ¶ added in v1.0.4
func (c *CompositeConnectionResolver) ValidateCredential(correlationId string, credential *auth.CredentialParams) error
ValidateCredential parameters. This method can be override in child classes.
Parameters: - correlationId (optional) transaction id to trace execution through call chain. - credential parameters to be validated Returns: error or nil if validation was successful
type ConnectionParams ¶
type ConnectionParams struct {
*config.ConfigParams
}
ConnectionParams contains connection parameters to connect to external services. They are used together with credential parameters, but usually stored separately from more protected sensitive values.
Configuration parameters: - discovery_key: key to retrieve parameters from discovery service - protocol: connection protocol like http, https, tcp, udp - host: host name or IP address - port: port number - uri: resource URI or connection string with all parameters in it
In addition to standard parameters ConnectionParams may contain any number of custom parameters
see ConfigParams see CredentialParams see ConnectionResolver see IDiscovery Example ConnectionParams object usage: connection := NewConnectionParamsFromTuples( ConnectionParamProtocol, "http", ConnectionParamHost, "10.1.1.100", ConnectionParamPort, "8080", ConnectionParamCluster, "mycluster" ); host := connection.Host(); // Result: "10.1.1.100" port := connection.Port(); // Result: 8080 cluster := connection.GetAsNullableString(ConnectionParamCluster); // Result: "mycluster"
func NewConnectionParams ¶
func NewConnectionParams(values map[string]string) *ConnectionParams
NewConnectionParams creates a new connection parameters and fills it with values.
Parameters: - values map[string]string an object to be converted into key-value pairs to initialize this connection. Returns: *ConnectionParams
func NewConnectionParamsFromConfig ¶
func NewConnectionParamsFromConfig(config *config.ConfigParams) *ConnectionParams
NewConnectionParamsFromConfig retrieves a single ConnectionParams from configuration parameters from "connection" section. If "connections" section is present instead, then is returns only the first connection element.
Parameters: - config *config.ConfigParams ConnectionParams, containing a section named "connection(s)". Returns: *ConnectionParams the generated ConnectionParams object.
func NewConnectionParamsFromMaps ¶
func NewConnectionParamsFromMaps(maps ...map[string]string) *ConnectionParams
NewConnectionParamsFromMaps static method for creating a StringValueMap using the maps passed as parameters.
Parameters: - maps ...map[string]string the maps passed to this method to create a StringValueMap with. Returns: ConnectionParams the ConnectionParams created.
func NewConnectionParamsFromString ¶
func NewConnectionParamsFromString(line string) *ConnectionParams
NewConnectionParamsFromString creates a new ConnectionParams object filled with key-value pairs serialized as a string.
Parameters: - line string a string with serialized key-value pairs as "key1=value1;key2=value2;..." Example: "Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z" Returns: *ConnectionParams a new ConnectionParams object.
func NewConnectionParamsFromTuples ¶
func NewConnectionParamsFromTuples(tuples ...any) *ConnectionParams
NewConnectionParamsFromTuples creates a new ConnectionParams object filled with provided key-value pairs called tuples. Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.
Parameters: - tuples ...any the tuples to fill a new ConnectionParams object. Returns: *ConnectionParams a new ConnectionParams object.
func NewConnectionParamsFromTuplesArray ¶
func NewConnectionParamsFromTuplesArray(tuples []any) *ConnectionParams
NewConnectionParamsFromTuplesArray method for creating a StringValueMap from an array of tuples.
Parameters: - tuples []any the key-value tuples array to initialize the new StringValueMap with. Returns: *ConnectionParams the ConnectionParams created and filled by the 'tuples' array provided.
func NewConnectionParamsFromValue ¶
func NewConnectionParamsFromValue(value any) *ConnectionParams
NewConnectionParamsFromValue method that creates a ConfigParams object based on the values that are stored in the 'value' object's properties.
see RecursiveObjectReader.GetProperties Parameters: - value any configuration parameters in the form of an object with properties. Returns: ConnectionParams generated ConnectionParams.
func NewEmptyConnectionParams ¶
func NewEmptyConnectionParams() *ConnectionParams
NewEmptyConnectionParams creates a new connection parameters and fills it with values.
Returns: *ConnectionParams
func NewManyConnectionParamsFromConfig ¶
func NewManyConnectionParamsFromConfig(config *config.ConfigParams) []*ConnectionParams
NewManyConnectionParamsFromConfig retrieves all ConnectionParams from configuration parameters from "connections" section. If "connection" section is present instead, than it returns a list with only one ConnectionParams.
Parameters: - config *config.ConfigParams a configuration parameters to retrieve connections Returns: []*ConnectionParams a list of retrieved ConnectionParams
func (*ConnectionParams) DiscoveryKey ¶
func (c *ConnectionParams) DiscoveryKey() string
DiscoveryKey gets the key to retrieve this connection from DiscoveryService. If this key is null, then all parameters are already present.
see UseDiscovery Returns: string the discovery key to retrieve connection.
func (*ConnectionParams) Host ¶
func (c *ConnectionParams) Host() string
Host gets the host name or IP address.
Returns: string the host name or IP address.
func (*ConnectionParams) Port ¶
func (c *ConnectionParams) Port() int
Port gets the port number.
Returns int the port number.
func (*ConnectionParams) PortWithDefault ¶
func (c *ConnectionParams) PortWithDefault(defaultValue int) int
PortWithDefault gets the port number.
Parameters: - defaultValue int default port number Returns: int the port number.
func (*ConnectionParams) Protocol ¶
func (c *ConnectionParams) Protocol() string
Protocol gets the connection protocol.
Returns: string the connection protocol or the default value if it's not set.
func (*ConnectionParams) ProtocolWithDefault ¶
func (c *ConnectionParams) ProtocolWithDefault(defaultValue string) string
ProtocolWithDefault gets the connection protocol.
Parameters: - defaultValue string the default protocol Returns: string the connection protocol or the default value if it's not set.
func (*ConnectionParams) SetDiscoveryKey ¶
func (c *ConnectionParams) SetDiscoveryKey(value string)
SetDiscoveryKey sets the key to retrieve these parameters from DiscoveryService.
Parameters: - value string a new key to retrieve connection.
func (*ConnectionParams) SetHost ¶
func (c *ConnectionParams) SetHost(value string)
SetHost sets the host name or IP address.
Parameters: - value string a new host name or IP address.
func (*ConnectionParams) SetPort ¶
func (c *ConnectionParams) SetPort(value int)
SetPort sets the port number.
see Host Parameters: value int a new port number.
func (*ConnectionParams) SetProtocol ¶
func (c *ConnectionParams) SetProtocol(value string)
SetProtocol sets the connection protocol.
Parameters: - value string a new connection protocol.
func (*ConnectionParams) SetUri ¶
func (c *ConnectionParams) SetUri(value string)
SetUri sets the resource URI or connection string.
Parameters: - value string a new resource URI or connection string.
func (*ConnectionParams) Uri ¶
func (c *ConnectionParams) Uri() string
Uri gets the resource URI or connection string. Usually it includes all connection parameters in it.
Returns: string the resource URI or connection string.
func (*ConnectionParams) UseDiscovery ¶
func (c *ConnectionParams) UseDiscovery() bool
UseDiscovery checks if these connection parameters shall be retrieved from DiscoveryService. The connection parameters are redirected to DiscoveryService when discovery_key parameter is set.
Returns: bool true if connection shall be retrieved from DiscoveryService
type ConnectionResolver ¶
type ConnectionResolver struct {
// contains filtered or unexported fields
}
ConnectionResolver helper class to retrieve component connections. If connections are configured to be retrieved from IDiscovery, it automatically locates IDiscovery in component references and retrieve connections from there using discovery_key parameter.
Configuration parameters - connection: - discovery_key: (optional) a key to retrieve the connection from IDiscovery - ... other connection parameters - connections: alternative to connection - [connection params 1]: first connection parameters - ... connection parameters for key 1 - [connection params N]: Nth connection parameters - ... connection parameters for key N References: - *:discovery:*:*:1.0 (optional) IDiscovery services to resolve connections see ConnectionParams see IDiscovery Example: config = NewConfigParamsFromTuples( "connection.host", "10.1.1.100", "connection.port", 8080 ); connectionResolver := NewConnectionResolver(); connectionResolver.Configure(context.Background(), config); connectionResolver.SetReferences(context.Background(), references); res, err := connectionResolver.Resolve("123");
func NewConnectionResolver ¶
func NewConnectionResolver(ctx context.Context, config *config.ConfigParams, references refer.IReferences) *ConnectionResolver
NewConnectionResolver Creates a new instance of connection resolver.
Parameters: - ctx context.Context - config *config.ConfigParams component configuration parameters - references refer.IReferences component references Returns: *ConnectionResolver
func NewEmptyConnectionResolver ¶
func NewEmptyConnectionResolver() *ConnectionResolver
NewEmptyConnectionResolver creates a new instance of connection resolver.
Returns: *ConnectionResolver
func (*ConnectionResolver) Add ¶
func (c *ConnectionResolver) Add(connection *ConnectionParams)
Add a new connection to component connections
Parameters: - connection *ConnectionParams new connection parameters to be added
func (*ConnectionResolver) Configure ¶
func (c *ConnectionResolver) Configure(ctx context.Context, config *config.ConfigParams)
Configure Configures component by passing configuration parameters.
Parameters: - ctx context.Context - config *config.ConfigParams configuration parameters to be set.
func (*ConnectionResolver) GetAll ¶
func (c *ConnectionResolver) GetAll() []*ConnectionParams
GetAll gets all connections configured in component configuration. Redirect to Discovery services is not done at this point. If you need fully fleshed connection use resolve method instead.
Returns: []*ConnectionParams a list with connection parameters
func (*ConnectionResolver) Register ¶
func (c *ConnectionResolver) Register(correlationId string, connection *ConnectionParams) error
Register the given connection in all referenced discovery services. This method can be used for dynamic service discovery.
see IDiscovery Parameters: - correlationId string transaction id to trace execution through call chain. - connection *ConnectionParams a connection to register. Returns: error
func (*ConnectionResolver) Resolve ¶
func (c *ConnectionResolver) Resolve(correlationId string) (*ConnectionParams, error)
Resolve a single component connection. If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there.
see IDiscovery Parameters: - correlationId: string transaction id to trace execution through call chain. Returns: *ConnectionParams, error resolved connection or error.
func (*ConnectionResolver) ResolveAll ¶
func (c *ConnectionResolver) ResolveAll(correlationId string) ([]*ConnectionParams, error)
ResolveAll resolves all component connection. If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there.
see IDiscovery Parameters: - correlationId string transaction id to trace execution through call chain. Returns: []*ConnectionParams, error resolved connections or error.
func (*ConnectionResolver) SetReferences ¶
func (c *ConnectionResolver) SetReferences(ctx context.Context, references refer.IReferences)
SetReferences sets references to dependent components.
Parameters: - ctx context.Context - references refer.IReferences references to locate the component dependencies.
type ICompositeConnectionResolverOverrides ¶ added in v1.0.4
type ICompositeConnectionResolverOverrides interface { ValidateConnection(correlationId string, connection *ConnectionParams) error ValidateCredential(correlationId string, credential *auth.CredentialParams) error ComposeOptions(connections []*ConnectionParams, credential *auth.CredentialParams, parameters *config.ConfigParams) *config.ConfigParams MergeConnection(options *config.ConfigParams, connection *ConnectionParams) *config.ConfigParams MergeCredential(options *config.ConfigParams, credential *auth.CredentialParams) *config.ConfigParams MergeOptional(options *config.ConfigParams, parameters *config.ConfigParams) *config.ConfigParams FinalizeOptions(options *config.ConfigParams) *config.ConfigParams }
type IDiscovery ¶
type IDiscovery interface { // Register connection parameters into the discovery service. Register(correlationId string, key string, connection *ConnectionParams) (result *ConnectionParams, err error) // ResolveOne a single connection parameters by its key. ResolveOne(correlationId string, key string) (result *ConnectionParams, err error) // ResolveAll all connection parameters by their key. ResolveAll(correlationId string, key string) (result []*ConnectionParams, err error) }
IDiscovery interface for discovery services which are used to store and resolve connection parameters to connect to external services.
type MemoryDiscovery ¶
type MemoryDiscovery struct {
// contains filtered or unexported fields
}
MemoryDiscovery discovery service that keeps connections in memory.
Configuration parameters [connection key 1]: ... connection parameters for key 1 [connection key 2]: ... connection parameters for key N see IDiscovery see ConnectionParams Example config := NewConfigParamsFromTuples( "connections.key1.host", "10.1.1.100", "connections.key1.port", "8080", "connections.key2.host", "10.1.1.100", "connections.key2.port", "8082" ); discovery := NewMemoryDiscovery(); discovery.ReadConnections(config); conn, err := discovery.ResolveOne("123", "key1");
Result: host=10.1.1.100;port=8080
func NewEmptyMemoryDiscovery ¶
func NewEmptyMemoryDiscovery() *MemoryDiscovery
NewEmptyMemoryDiscovery creates a new instance of discovery service.
Returns: *MemoryDiscovery
func NewMemoryDiscovery ¶
func NewMemoryDiscovery(ctx context.Context, config *config.ConfigParams) *MemoryDiscovery
NewMemoryDiscovery creates a new instance of discovery service.
Parameters: - ctx context.Context - config *config.ConfigParams configuration with connection parameters. Returns: *MemoryDiscovery
func (*MemoryDiscovery) Configure ¶
func (c *MemoryDiscovery) Configure(ctx context.Context, config *config.ConfigParams)
Configure component by passing configuration parameters.
Parameters: - ctx context.Context - config *config.ConfigParams configuration parameters to be set.
func (*MemoryDiscovery) ReadConnections ¶
func (c *MemoryDiscovery) ReadConnections(config *config.ConfigParams)
ReadConnections from configuration parameters. Each section represents an individual Connectionparams
Parameters: - ctx context.Context - config *configure.ConfigParams configuration parameters to be read
func (*MemoryDiscovery) Register ¶
func (c *MemoryDiscovery) Register(correlationId string, key string, connection *ConnectionParams) (result *ConnectionParams, err error)
Register connection parameters into the discovery service.
Parameters: - correlationId string transaction id to trace execution through call chain. - key string a key to uniquely identify the connection parameters. - connection *ConnectionParams Returns: *ConnectionParams, error registered connection or error.
func (*MemoryDiscovery) ResolveAll ¶
func (c *MemoryDiscovery) ResolveAll(correlationId string, key string) (result []*ConnectionParams, err error)
ResolveAll connection parameters by its key.
Parameters: - correlationId: string transaction id to trace execution through call chain. - key: string a key to uniquely identify the connection. Returns: *ConnectionParams, error receives found connection or error.
func (*MemoryDiscovery) ResolveOne ¶
func (c *MemoryDiscovery) ResolveOne(correlationId string, key string) (result *ConnectionParams, err error)
ResolveOne a single connection parameters by its key.
Parameters: - correlationId: string transaction id to trace execution through call chain. - key: string a key to uniquely identify the connection. Returns: *ConnectionParams, error receives found connection or error.