Caravan.Cluster.Config (caravan v1.0.1)

Config for Caravan.Cluster.DnsStrategy.

  • topology: topology name passed to Cluster.Strategy.connect_nodes/4
  • query: The name to query for SRV records. Something like: prod-likes-service-dist-consul
  • dns_client: module implementing Caravan.DnsClient. Defaults to Caravan.DnsClient.InetRes.
  • node_sname: the base of a node name. App name is a good candidate.
  • connect: Override to use a different transport mechanism. Uses :libcluster defaults otherwise.
  • disconnect: Override to use a different transport mechanism. Uses :libcluster defaults otherwise.
  • list_nodes: Override to use a different transport mechanism. Uses :libcluster defaults otherwise.
  • poll_interval: poll the dns server on this interval. Defaults to 5_000

Summary

Functions

Takes a Cluster.Strategy.State and returns a Config struct

Types

t()

@type t() :: %Caravan.Cluster.Config{
  connect: {:atom, :atom, list()},
  disconnect: {:atom, :atom, list()},
  dns_client: atom(),
  list_nodes: {:atom, :atom, list()},
  node_sname: String.t(),
  poll_interval: integer(),
  query: String.t(),
  topology: atom()
}

Functions

new(state)

@spec new(state :: Cluster.Strategy.State.t()) :: t()

Takes a Cluster.Strategy.State and returns a Config struct