Crawler v0.3.1 Crawler.Options

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

Link to this function assign_defaults(opts)

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
Link to this function assign_url(opts, url)

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