exhtml v0.4.0-beta.3 Exhtml.Host

Exhtml.Host represents the content server.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Deletes the content from a host

Gets html content from a host

Gets html content from a host with cache time

Sets html content to a host with a slug

Sets the content fetcher. A fetcher is used to fetch content from the data source, such as a remote server

Starts a host

Fetchs and sets the content from the storage to a host’s table

Link to this section Types

Link to this section Functions

Link to this function child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function delete_content(server, slug)
delete_content(server(), slug()) :: :ok

Deletes the content from a host.

  • server - the PID or name of the process
  • slug - the key of the content
Link to this function get_content(server, slug)
get_content(server(), slug()) :: any()

Gets html content from a host.

  • server - the PID or name of the process
  • slug - the key of the content
Link to this function get_content_since(server, slug, time)
get_content_since(server(), slug(), DateTime.t()) :: any()

Gets html content from a host with cache time.

  • server - the PID or name of the process
  • slug - the key of the content
  • time - the modified time to check.
Link to this function set_content(server, slug, value)
set_content(server(), slug(), any()) :: :ok

Sets html content to a host with a slug.

  • server - the PID or name of the process
  • slug - the key of the content
  • value - the content to save

Returns :ok.

Link to this function set_content_fetcher(server, f)
set_content_fetcher(server(), (slug() -> any()) | module()) :: :ok

Sets the content fetcher. A fetcher is used to fetch content from the data source, such as a remote server.

  • server - the PID or name of the process
  • f - function or module to fetch content
Link to this function start_link(opts \\ [])

Starts a host.

  • opts - options for starting the process

Link to this function update_content(server, slug)
update_content(server(), slug()) :: any()

Fetchs and sets the content from the storage to a host’s table.

  • server - the PID or name of the process
  • slug - the key of the content

Returns content fetched.