gen_router v0.1.6 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;
- halted: stop the pipeline execution if conn was settled.
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
Halt execution pipeline, Conn is settled
Reset router matching pipeline
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 \\ :default, scope \\ :default, code \\ :default)
Update state and complete the current request.
Link to this function
forward(conn, path \\ "/", scope \\ %{}, opts \\ [])
Put the next path after the current request.
It unhalts settled conn, so all the pipelines will be executed again.
Link to this function
halt(conn)
Halt execution pipeline, Conn is settled.
Link to this function
reset_router_matches(conn, router_module)
Reset router matching pipeline