View Source cowmachine (cowmachine v1.13.1)

Cowmachine: webmachine middleware for Cowboy/Zotonic

Summary

Functions

Handle a request, executes the cowmachine http states. Can be used by middleware functions to add some additional initialization of controllers or context.

Types

cmstate/0

-type cmstate() ::
          #cmstate{controller :: atom(),
                   is_process_called :: boolean(),
                   cache :: map(),
                   options :: map()}.

Functions

log(Report)

-spec log(Report) -> Result when Report :: map(), Result :: any().

log(Report, Req)

-spec log(Report, Req) -> Result when Report :: map(), Req :: map(), Result :: any().

request(Context, Options)

-spec request(Context, Options) -> Result
                 when
                     Context :: cowmachine_req:context(),
                     Options :: map(),
                     Req :: cowboy_req:req(),
                     Env :: cowboy_middleware:env(),
                     Result :: {ok, Req, Env} | {stop, Req}.

Handle a request, executes the cowmachine http states. Can be used by middleware functions to add some additional initialization of controllers or context.