liaison v0.1.0 Liaison.NodeHelper View Source

NodeHelper aims to make converting between node representations into FQDN nodenames

Auto Localhost Calculation

Ever tried to connect to another local node but your machine name is not fun to enter? Now all you need to do is enter a name for the node and the localhost is automatically appended

Node Formats

The following is a list of valid node formats and how they are expanded

  • name -> :name@localhost
  • name@host -> :name@host
  • name@a.b.c.d -> :"name@a.b.c.d"
  • %{name: name} -> :name@localhost
  • %{name: :random} -> random 6 digit name, eg: :atj2ld@localhost
  • %{name: [random: 3]} -> random 3 digit name, eg::d5h@localhost
  • %{name: name, host: host} -> :name@host
  • %{name: name, host: :shortname} -> :name@localhost
  • %{name: name, host: :longname} -> :name@localhost_ip

Link to this section Summary

Functions

Returns the localhost name of the machine

Returns the first ip4 address for the machine

Returns a random alphanumeric localhost name of length len

Expands a node format into a fully qualified nodename

Link to this section Types

Link to this type

node_format()

View Source
node_format() :: String.t() | atom() | map()
Link to this type

nodename()

View Source
nodename() :: atom()

Link to this section Functions

Link to this function

get_localhost()

View Source
get_localhost() :: charlist()

Returns the localhost name of the machine

Link to this function

get_localhost_ip()

View Source
get_localhost_ip() :: String.t()

Returns the first ip4 address for the machine

Link to this function

random_name(len \\ 6)

View Source
random_name(integer()) :: String.t()

Returns a random alphanumeric localhost name of length len

Link to this function

to_nodename(format)

View Source
to_nodename(node_format()) :: nodename()

Expands a node format into a fully qualified nodename