# messengyr v0.0.1 Messengyr.Web.Endpoint

# Summary

## Functions

__sockets__()

Returns all sockets configured in this endpoint

broadcast(topic, event, msg)
broadcast!(topic, event, msg)
broadcast_from(from, topic, event, msg)
broadcast_from!(from, topic, event, msg)
call(conn, opts)

Callback implementation for `Plug.call/2`

config(key, default \\ nil)

Returns the endpoint configuration for `key`

config_change(changed, removed)

Reloads the configuration given the application environment changes

host()

Returns the host for the given endpoint

init(opts)

Callback implementation for `Plug.init/1`

instrument(event, runtime \\ Macro.escape(%{}), fun)

Instruments the given function

load_from_system_env(config)

Dynamically loads configuration from the system environment on startup

path(path)

Generates the path information when routing to this endpoint

script_name()

Generates the script name

start_link()

Starts the endpoint supervision tree

static_path(path)

Generates a route to a static file in `priv/static`

static_url()

Generates the static URL without any path information

struct_url()

Generates the endpoint base URL but as a `URI` struct

subscribe(topic)
subscribe(pid, topic, opts)
unsubscribe(topic)
url()

Generates the endpoint base URL without any path information

# Functions

__sockets__()

Returns all sockets configured in this endpoint.

broadcast(topic, event, msg)
broadcast!(topic, event, msg)
broadcast_from(from, topic, event, msg)
broadcast_from!(from, topic, event, msg)
call(conn, opts)

Callback implementation for `Plug.call/2`.

config(key, default \\ nil)

Returns the endpoint configuration for `key`

Returns `default` if the key does not exist.

config_change(changed, removed)

Reloads the configuration given the application environment changes.

host()

Returns the host for the given endpoint.

init(opts)

Callback implementation for `Plug.init/1`.

instrument(event, runtime \\ Macro.escape(%{}), fun) (macro)

Instruments the given function.

`event` is the event identifier (usually an atom) that specifies which instrumenting function to call in the instrumenter modules. `runtime` is metadata to be associated with the event at runtime (e.g., the query being issued if the event to instrument is a DB query).

## Examples

    instrument :render_view, %{view: "index.html"}, fn ->
      render conn, "index.html"
    end

load_from_system_env(config)

Dynamically loads configuration from the system environment on startup.

It receives the endpoint configuration from the config files and must return the updated configuration.

path(path)

Generates the path information when routing to this endpoint.

script_name()

Generates the script name.

start_link()

Starts the endpoint supervision tree.

static_path(path)

Generates a route to a static file in `priv/static`.

static_url()

Generates the static URL without any path information.

It uses the configuration under `:static_url` to generate such. It falls back to `:url` if `:static_url` is not set.

struct_url()

Generates the endpoint base URL but as a `URI` struct.

It uses the configuration under `:url` to generate such. Useful for manipulating the URL data and passing it to URL helpers.

subscribe(topic)
subscribe(pid, topic, opts)
unsubscribe(topic)
url()

Generates the endpoint base URL without any path information.

It uses the configuration under `:url` to generate such.