View Source Camarero.Catering.Routes (camarero v1.0.3)

Internal state for all the routes known to this application

Summary

Functions

Internally stored map of routes to handlers

Retrieves the handler for the route specified

Stores a handler for the route specified

Starts an agent linked to the current process

Returns the whole mapping of routes to handlers

Types

Functions

Internally stored map of routes to handlers

@spec get(key :: binary()) :: module()

Retrieves the handler for the route specified

@spec put(key :: binary(), value :: [tuple()] | module()) :: :ok

Stores a handler for the route specified

Link to this function

start_link(opts \\ [], initial \\ %{})

View Source
@spec start_link(Keyword.t(), map()) ::
  {:ok, pid()} | {:error, {:already_started, pid()} | term()}

Starts an agent linked to the current process

@spec state() :: map()

Returns the whole mapping of routes to handlers