connect

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitMQConnectionResolver

type RabbitMQConnectionResolver struct {
	// The connections resolver.
	ConnectionResolver *ccon.ConnectionResolver
	//The credentials resolver.
	CredentialResolver *cauth.CredentialResolver
}

RabbitMQConnectionResolver helper class that resolves RabbitMQ 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
  • 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 NewRabbitMQConnectionResolver

func NewRabbitMQConnectionResolver() *RabbitMQConnectionResolver

func (*RabbitMQConnectionResolver) Compose

func (c *RabbitMQConnectionResolver) Compose(correlationId string, connection *ccon.ConnectionParams, credential *cauth.CredentialParams) (options *cconf.ConfigParams, err error)

Compose method are composes RabbitMQ connection options from connection and credential parameters. Parameters:

  • ctx context.Context
  • correlationId string (optional) transaction id to trace execution through call chain.
  • connection *ccon.ConnectionParams connection parameters
  • credential *cauth.CredentialParams credential parameters

Returns: options *cconf.ConfigParams, err error resolved options or error.

func (*RabbitMQConnectionResolver) Configure

func (c *RabbitMQConnectionResolver) Configure(ctx context.Context, config *cconf.ConfigParams)

Configure are configures component by passing configuration parameters. Parameters:

  • ctx context.Context
  • config *cconf.ConfigParams

configuration parameters to be set.

func (*RabbitMQConnectionResolver) Resolve

func (c *RabbitMQConnectionResolver) Resolve(correlationId string) (options *cconf.ConfigParams, err error)

Resolves RabbitMQ connection options from connection and credential parameters. Parameters:

  • ctx context.Context
  • correlationId (optional) transaction id to trace execution through call chain.

Retruns options *cconf.ConfigParams, err error receives resolved options or error.

func (*RabbitMQConnectionResolver) SetReferences

func (c *RabbitMQConnectionResolver) SetReferences(ctx context.Context, references cref.IReferences)

SetReferences are sets references to dependent components. Parameters:

  • ctx context.Context
  • references cref.IReferences

references to locate the component dependencies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL