exhtml v0.3.1 Exhtml.Host

Exhtml.Host represents the content server.

Summary

Functions

Deletes the content from a host

Gets html content from a host

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

Types

server()
server() :: GenServer.server
slug()
slug() :: Exhtml.slug

Functions

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
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
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.

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
start_link(opts \\ [])

Starts a host.

  • opts - options for starting the process

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.