Crawler.Options (Crawler v1.1.2) View Source

Options for the crawler.

Link to this section Summary

Functions

Assigns default option values.

Takes the url argument and puts it in the opts.

Link to this section Functions

Assigns default option values.

Examples

iex> Options.assign_defaults(%{}) |> Map.has_key?(:depth)
true

iex> Options.assign_defaults(%{}) |> Map.get(:max_depths)
3

iex> Options.assign_defaults(%{max_depths: 4}) |> Map.get(:max_depths)
4

Takes the url argument and puts it in the opts.

The opts map gets passed around internally and eventually gets stored in the registry.

Examples

iex> Options.assign_url(%{}, "http://options/")
%{url: "http://options/"}

iex> Options.assign_url(%{url: "http://example.com/"}, "http://options/")
%{url: "http://options/"}