Function guessAddressType

Returns the type of address that is represented in address

TYPE guessAddressType (
  in const(char[]) address
) pure @safe;

When one is presented with a string, e.g. from user input, the correect type might need to be guessed. In Agora's case, there are only three kind of addresses that may be guessed: domain names (CNAME), IPv4 addresses (A), or IPv6 addresses (AAAA).

This function implements a few heuristics to guess which one it is. By default, we consider that an address is a CNAME.

Parameters

NameDescription
address The string to guess the type of

Returns

By default, TYPE.CNAME, and depending on the format, either TYPE.A or TYPE.AAAA