Exoplanet.Config (Exoplanet v0.4.0)

Copy Markdown View Source

Exoplanet configuration.

Required keys:

  • sources — map of feed_url => %{name: ...} (plus optional per-feed keys like homepage, language, filters)

Optional keys (with defaults):

  • default_filters — global content filters (see Exoplanet.Filters)
  • new_feed_items (4) — max posts kept per feed per rebuild
  • feed_timeout (20) — per-feed HTTP timeout in seconds
  • items (60) — total post cap across all feeds

This struct holds only the fields that Exoplanet.build/1 actually reads. Site-level metadata (planet name, owner, about page, related sites, …) belongs to the consumer (e.g. planet_beam), not to this library.

Summary

Functions

Creates Exoplanet.Config from the given file.

Types

t()

@type t() :: %Exoplanet.Config{
  default_filters: Exoplanet.Filters.t(),
  feed_timeout: pos_integer(),
  items: pos_integer(),
  new_feed_items: pos_integer(),
  sources: map()
}

Functions

from_file(path)

@spec from_file(Path.t()) :: t()

Creates Exoplanet.Config from the given file.

Unknown keys in the file are ignored, so consumers may keep additional metadata in the same .exs file without conflicting with this struct.