SmeeFeds.Federation (SmeeFeds v0.1.1) View Source

Federation provides structs that represents federated metadata publishers, and some simple tools to manage the information in them.

Link to this section Summary

Functions

Returns the default aggregate metadata details for the federation, or nil if none has been defined.

Gets the general contact information for the federation as a URL.

Returns the countries associated with the federation as Countries structs.

Returns the default MDQ service for the federation, or nil if none has been defined.

Creates a new Federation struct. The only requirement is a unique ID, passed as the first parameter.

Returns the policy URL for the federation (if known) or nil

Lists all sources for the federation (it does not return their keys/labels)

Returns the homepage URL for the federation, or nil.

Link to this section Types

Specs

t() :: %SmeeFeds.Federation{
  contact: nil | binary(),
  countries: list(),
  id: atom(),
  name: nil | binary(),
  policy: nil | binary(),
  sources: map(),
  uri: nil | binary(),
  url: nil | binary()
}

Link to this section Functions

Specs

aggregate(federation :: t()) :: Smee.Source.t() | nil

Returns the default aggregate metadata details for the federation, or nil if none has been defined.

Specs

contact(federation :: t()) :: binary()

Gets the general contact information for the federation as a URL.

Specs

countries(federation :: t()) :: [binary()]

Returns the countries associated with the federation as Countries structs.

See Countries documentation for more information.

Specs

mdq(federation :: t()) :: Smee.Source.t() | nil

Returns the default MDQ service for the federation, or nil if none has been defined.

Creates a new Federation struct. The only requirement is a unique ID, passed as the first parameter.

Other information can be passed as an option:

  • contact: general contact address for the federation, as a URL.
  • name: The full, official name of the federation
  • url: The URL of the federation's homepage
  • uri: The publisher URI of the federation
  • countries: A list of 2-letter country codes for countries the federation officially provides services for.
  • policy: URL for the federation's metadata policy documentation
  • sources: Map of atom IDs and Smee.Source structs. Use default: for the default aggregate, and mdq: for the default MDQ service.

SmeeFeds comes with a list of built-in federations - use SmeeFeds.federations/0 to view them.

Specs

policy_url(federation :: t()) :: binary()

Returns the policy URL for the federation (if known) or nil

Specs

sources(federation :: t()) :: [Smee.Source.t()]

Lists all sources for the federation (it does not return their keys/labels)

If no sources have been defined it will return an empty list.

Specs

url(federation :: t()) :: binary()

Returns the homepage URL for the federation, or nil.