Current section

Files

Jump to
crawlberg lib crawlberg batch_crawl_result.ex
Raw

lib/crawlberg/batch_crawl_result.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:bef55d0fe3bec2cfa1f7674a824b620a4f93eb1ab5475627f20db419d245a3e5
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Crawlberg.BatchCrawlResult do
@moduledoc "Result from a single URL in a batch crawl operation."
@typedoc "Result from a single URL in a batch crawl operation."
@type t :: %__MODULE__{
url: String.t() | nil,
result: Crawlberg.CrawlResult.t() | nil,
error: String.t() | nil
}
defstruct url: nil,
result: nil,
error: nil
defimpl Jason.Encoder do
@doc false
def encode(value, opts) do
value
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> v == nil end)
|> Enum.into(%{})
|> Jason.Encoder.encode(opts)
end
end
end