gen_router v0.1.1 GenRouter.Behaviour behaviour

Callbacks for custom implementation for the Router.

Link to this section Summary

Callbacks

Renders the view and deliver response to the end client

Function which converts generic message into GenRouter.Conn structure then match it according to the router specification

Link to this section Types

Link to this type

assigns()
assigns() :: map()

Link to this type

message()
message() :: map()

Link to this type

opts()
opts() :: Keyword.t()

Link to this type

params()
params() :: map()

Link to this type

path()
path() :: String.t()

Link to this type

router()
router() :: module()

Link to this type

scope()
scope() :: map()

Link to this type

template()
template() :: String.t()

Link to this type

view()
view() :: module()

Link to this section Callbacks

Link to this callback

deliver(%, view, template, params, opts)
deliver(
  %GenRouter.Conn{
    __skip__: term(),
    assigns: term(),
    code: term(),
    params: term(),
    path: term(),
    response: term(),
    scope: term()
  },
  view(),
  template(),
  params(),
  opts()
) :: %GenRouter.Conn{
  __skip__: term(),
  assigns: term(),
  code: term(),
  params: term(),
  path: term(),
  response: term(),
  scope: term()
}

Renders the view and deliver response to the end client.

Link to this callback

match_message(router, message, path, scope, assigns, opts)
match_message(router(), message(), path(), scope(), assigns(), opts()) ::
  %GenRouter.Conn{
    __skip__: term(),
    assigns: term(),
    code: term(),
    params: term(),
    path: term(),
    response: term(),
    scope: term()
  }

Function which converts generic message into GenRouter.Conn structure then match it according to the router specification.