gen_router v0.1.1 GenRouter.Conn
Structure which represents connection with Telegram bot. Inspired by %Plug.Conn{}, adapted for bots.
Attributes:
- skip: system buffer to keep track of skipped scopes;
- path: route to controller which should handle this object;
- params: payload which will be passed to controller;
- assigns: non-parsed data assigned by a system (auth, etc);
- scope: local scope of current request, clears for each new route;
- code: response code, we use common HTTP codes, currently only 200 is supported.
- response: response payload, usually JSON
Link to this section Summary
Functions
Assign variable to current request
Build Conn object with system fields
Update state and complete the current request
Put the next path after the current request
Link to this section Types
Link to this section Functions
Link to this function
assign(conn, key, value)
Assign variable to current request.
Link to this function
build(router_module, map)
Build Conn object with system fields
Link to this function
complete(conn, response \\ nil, scope \\ %{}, code \\ 200)
Update state and complete the current request.
Link to this function
forward(conn, path \\ "/", scope \\ %{}, opts \\ [])
Put the next path after the current request.