View Source Crawler.Options (Crawler v1.5.0)

Options for the crawler.

Summary

Functions

Assigns default option values.

Takes the url argument and puts it in the opts.

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/"}