View Source MishkaInstaller.Reference.OnRouter behaviour (Mishka Installer v0.0.3)

elixir-macros-for-router

elixir macros for router

  live(path, live_view, action \ nil, opts \ [])
  live "/", TrackappWeb.Live.DepGetter

  delete(path, plug, plug_opts, options \ [])
  delete("/events/:id", EventController, :action)

  forward(path, plug, plug_opts \ [], router_opts \ [])
  forward "/admin", SomeLib.AdminDashboard

  get(path, plug, plug_opts, options \ [])
  get("/events/:id", EventController, :action)

  post(path, plug, plug_opts, options \ [])
  post("/events/:id", EventController, :action)

  put(path, plug, plug_opts, options \ [])
  put("/events/:id", EventController, :action)

Link to this section Summary

Link to this section Types

@type action() :: :get | :post | :live | :delete | :put | :forward
@type endpoint() :: module()
@type optional_callbacks() ::
  {:ok, ref(), registerd_info()} | {:error, ref(), reason()}
@type path() :: String.t()
@type reason() :: map()
@type ref() :: :on_router
@type registerd_info() :: MishkaInstaller.PluginState.t()
@type state() :: %MishkaInstaller.Reference.OnRouter{
  action: action(),
  endpoint: endpoint(),
  path: path(),
  plug_opts: list(),
  type: type()
}
@type t() :: state()
@type type() :: atom()

Link to this section Callbacks

@callback call(state()) :: {:reply, state()} | {:reply, :halt, state()}
Link to this callback

delete(registerd_info)

View Source (optional)
@callback delete(registerd_info()) :: optional_callbacks()
@callback initial(list()) :: {:ok, ref(), list()} | {:error, ref(), reason()}
Link to this callback

restart(registerd_info)

View Source (optional)
@callback restart(registerd_info()) :: optional_callbacks()
Link to this callback

start(registerd_info)

View Source (optional)
@callback start(registerd_info()) :: optional_callbacks()
Link to this callback

stop(registerd_info)

View Source (optional)
@callback stop(registerd_info()) :: optional_callbacks()
Link to this callback

unregister(registerd_info)

View Source (optional)
@callback unregister(registerd_info()) :: optional_callbacks()