Agnus.Types (agnus v0.1.1) View Source

Public API types

Link to this section Summary

Link to this section Types

Specs

cache_file() :: binary() | :none

Specs

daylength() :: pos_integer()

Specs

opts_map() :: %{
  api: %{
    lat: float(),
    lng: float(),
    url: binary(),
    fetcher: Agnus.Fetcher | module(),
    timeout: integer(),
    recv_timeout: integer()
  },
  tz: binary(),
  cache_file: cache_file(),
  timeout: binary(),
  log: %{init: boolean(), init_args: boolean(), cache_failures: boolean()}
}

Specs

suninfo() :: false | DateTime.t() | daylength()

Specs

suninfo_key() ::
  :sunrise
  | :sunset
  | :solar_noon
  | :day_length
  | :civil_twilight_begin
  | :civil_twilight_end
  | :nautical_twilight_begin
  | :nautical_twilight_end
  | :astronomical_twilight_begin
  | :astronomical_twilight_end

Specs

suninfo_request() :: :all | suninfo_key() | [suninfo_key()]

Specs

suninfo_response() ::
  false
  | %DateTime{
      calendar: term(),
      day: term(),
      hour: term(),
      microsecond: term(),
      minute: term(),
      month: term(),
      second: term(),
      std_offset: term(),
      time_zone: term(),
      utc_offset: term(),
      year: term(),
      zone_abbr: term()
    }
  | %{optional(suninfo_key()) => suninfo()}

Specs

trigger_opts() :: none() | [] | [{:force, boolean()}]