View Source Exonerate.Formats.IdnHostname (exonerate v1.1.3)

Module which provides a macro that generates special code for an idn-hostname filter. This is a hostname with internationalization support.

the format is governed by section 2.1 of RFC 1123, which modifies RFC 952: https://www.rfc-editor.org/rfc/rfc1123.txt https://www.rfc-editor.org/rfc/rfc952.txt

Link to this section Summary

Functions

Creates a parser ~idn-hostname/1.

Link to this section Functions

Link to this macro

filter(opts \\ [])

View Source (macro)

Creates a parser ~idn-hostname/1.

This function returns {:ok} if the passed string is a valid idn hostname, or {:error, reason} if it is not.

The function will only be created once per module, and it is safe to call the macro more than once.

warning

Warning

this function generates code that requires the :idna library.

options

Options:

  • :name (atom): the name of the function to create. Defaults to :"~idn-hostname"