EmqttFailover.Config (EmqttFailover v0.3.2)

Configuration for connecting to an MQTT broker.

Summary

Functions

Default ssl_opts configuration.

Converts a %URI{} struct into a %Elixir.EmqttFailover.Config struct.

Converts a URL into a %Elixir.EmqttFailover.Config{} struct.

Returns the ssl_opts to use for the given %Elixir.EmqttFailover.Config

Returns a Keyword.t() of options to pass to :emqtt.start_link/1

Renders the %Elixir.EmqttFailover.Config as a safe URL (no password)

Types

@type t() :: %EmqttFailover.Config{
  host: binary(),
  password: binary() | nil,
  port: pos_integer(),
  ssl?: boolean(),
  ssl_opts: [:ssl.tls_client_option()] | :default,
  username: binary() | nil
}

Functions

Link to this function

default_ssl_opts(hostname)

Default ssl_opts configuration.

Verifies the remote peer using the built-in :public_key.cacerts.get() certificates.

Link to this function

from_uri(uri, overrides \\ [])

@spec from_uri(URI.t(), Keyword.t()) :: t()

Converts a %URI{} struct into a %Elixir.EmqttFailover.Config struct.

Link to this function

from_url(url, overrides \\ [])

@spec from_url(String.t(), Keyword.t()) :: t()

Converts a URL into a %Elixir.EmqttFailover.Config{} struct.

Link to this function

ssl_opts(config)

Returns the ssl_opts to use for the given %Elixir.EmqttFailover.Config

Link to this function

to_emqtt(config)

@spec to_emqtt(t()) :: Keyword.t()

Returns a Keyword.t() of options to pass to :emqtt.start_link/1

Link to this function

to_safe_string(config)

@spec to_safe_string(t()) :: String.t()

Renders the %Elixir.EmqttFailover.Config as a safe URL (no password)