ConnectionUtils

A set of utility functions used to process connection parameters

Description

The ConnectionUtils class provides a set of utility functions used to process connection parameters.

Methods

ComposeUri

Composes URI from config parameters. The result URI will be in the following form:
protocol://username@password@host1:port1,host2:port2,…?param1=abc¶m2=xyz&…

ComposeUri(options *config.ConfigParams, defaultProtocol string, defaultPort int) string

  • options: *config.ConfigParams - configuration parameters
  • defaultProtocol: string - default protocol
  • defaultPort: int - default port
  • returns: string - composed URI

Concat

Concatinates two options by combining duplicated properties into comma-separated list

Concat(options1 *config.ConfigParams, options2 *config.ConfigParams, keys …string) *config.ConfigParams

Exclude

Excludes specified keys from the config parameters.

Exclude(options *config.ConfigParams, keys …string) *config.ConfigParams

Include

Includes specified keys from the config parameters.

Include(options *config.ConfigParams, keys …string) *config.ConfigParams

ParseUri

Parses URI into config parameters. The URI shall be in the following form: protocol://username@password@host1:port1,host2:port2,...?param1=abc¶m2=xyz&...

ParseUri(uri string, defaultProtocol string, defaultPort int) *config.ConfigParams

  • uri: string - URI to be parsed
  • defaultProtocol: string - default protocol
  • defaultPort: string - default port
  • returns: *config.ConfigParams - configuration parameters with URI elements