View Source Disposable.Source (Disposable v0.2.0)

Loads and validates disposable-domain sources.

Source files are UTF-8, newline-delimited, ASCII domain lists. Punycode labels are accepted, but Unicode domain labels are intentionally not normalized.

Summary

Functions

Returns the configured source, including the deprecated file setting.

Returns the configured URL-loading options.

Loads and parses a configured source.

Parses a UTF-8 newline-delimited domain list.

Validates one ASCII domain using exact-domain matching rules.

Validates a parsed domain set before publication.

Types

@type limits() :: [
  max_source_bytes: pos_integer(),
  max_line_bytes: pos_integer(),
  max_domain_count: pos_integer()
]
@type source() :: :bundled | {:file, String.t()} | {:url, String.t()}

Functions

@spec configured_source() :: term()

Returns the configured source, including the deprecated file setting.

Link to this function

configured_url_options()

View Source
@spec configured_url_options() :: keyword()

Returns the configured URL-loading options.

Link to this function

load(source, opts \\ [])

View Source
@spec load(
  term(),
  keyword()
) :: {:ok, MapSet.t()} | {:error, term()}

Loads and parses a configured source.

Link to this function

parse(contents, opts \\ [])

View Source
@spec parse(
  binary(),
  keyword()
) :: {:ok, MapSet.t()} | {:error, term()}

Parses a UTF-8 newline-delimited domain list.

@spec valid_domain?(term()) :: boolean()

Validates one ASCII domain using exact-domain matching rules.

Link to this function

validate_domains(domains)

View Source
@spec validate_domains(term()) :: :ok | {:error, term()}

Validates a parsed domain set before publication.