exhtml v0.4.0-beta.2 Exhtml.Table

Exhtml.Table provides a place to set and get HTML contents by slug.

Examples:

iex> {:ok, pid} = Exhtml.Table.start_link []
...> Exhtml.Table.set(pid, :foo, :bar)
:ok
...> Exhtml.Table.get(pid, :foo)
:bar

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Gets content of the slug from the store

Gets content of the slug from the store since the time

Removes content of the slug from the store

Sets content of the slug into the store

Starts a Exhtml.Table process.

  • opts - options for starting the process:

    • repo - the pid of started Exhtml.Repo server. If unprovided, all request to Exhtml.Table will return {:error, :repo_not_started} Returns {:ok, pid} if succeed, {:error, reason} otherwise

Start the repo engine. Before starting a repo, all actions will not be performed and {:error, :repo_not_started} will be returned

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 get(server, slug)
get(server(), slug()) :: any()

Gets content of the slug from the store.

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

Gets content of the slug from the store since the time.

  • server - PID or name of the server
  • slug - key of the content
  • since - modiefied time
Link to this function join_repo(server, remote, opts)
Link to this function rm(server, slug)
rm(server(), slug()) :: :ok

Removes content of the slug from the store.

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

Sets content of the slug into the store.

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

Examples:

iex> {:ok, pid} = Exhtml.Table.start_link []
...> Exhtml.Table.set(pid, :foo, :bar)
:ok
iex> Exhtml.Table.get(pid, :foo)
:bar
Link to this function start_link(opts)
start_link([{:key, any()}]) :: {:ok, pid()} | {:error, any()}

Starts a Exhtml.Table process.

  • opts - options for starting the process:

    • repo - the pid of started Exhtml.Repo server. If unprovided, all request to Exhtml.Table will return {:error, :repo_not_started} Returns {:ok, pid} if succeed, {:error, reason} otherwise.
Link to this function start_repo(server, opts)

Start the repo engine. Before starting a repo, all actions will not be performed and {:error, :repo_not_started} will be returned.