feed and item structs
This commit is contained in:
1 parent
03f10981a0
commit
94a51e0322
2 files changed
+53
No files matched your search
@@ -0,0 +1,26 @@
|
||||
defmodule FeedReader.Feed do
|
||||
@moduledoc """
|
||||
Normalized metadata for a feed.
|
||||
|
||||
Extension metadata is keyed by namespace URI. Format implementations control
|
||||
which bounded extension values are retained.
|
||||
"""
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
title: String.t() | nil,
|
||||
description: String.t() | nil,
|
||||
feed_url: String.t() | nil,
|
||||
html_url: String.t() | nil,
|
||||
type: :rss | :atom | :rdf,
|
||||
categories: [String.t()],
|
||||
extensions: %{optional(String.t()) => map()}
|
||||
}
|
||||
|
||||
defstruct title: nil,
|
||||
description: nil,
|
||||
feed_url: nil,
|
||||
html_url: nil,
|
||||
type: nil,
|
||||
categories: [],
|
||||
extensions: %{}
|
||||
end
|
||||
@@ -0,0 +1,27 @@
|
||||
defmodule FeedReader.Item do
|
||||
@moduledoc "A normalized item delivered by a feed parser."
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
uuid: String.t() | nil,
|
||||
title: String.t() | nil,
|
||||
content_full: String.t() | nil,
|
||||
content_summary: String.t() | nil,
|
||||
language: atom() | nil,
|
||||
published_at: DateTime.t() | nil,
|
||||
canonical_url: String.t() | nil,
|
||||
alternate: map(),
|
||||
author: String.t() | nil,
|
||||
extensions: %{optional(String.t()) => map()}
|
||||
}
|
||||
|
||||
defstruct uuid: nil,
|
||||
title: nil,
|
||||
content_full: nil,
|
||||
content_summary: nil,
|
||||
language: nil,
|
||||
published_at: nil,
|
||||
canonical_url: nil,
|
||||
alternate: %{},
|
||||
author: nil,
|
||||
extensions: %{}
|
||||
end
|
||||
Reference in new issue
Block a user