View Source cowmachine (cowmachine v1.10.3)

Cowmachine: webmachine middleware for Cowboy/Zotonic

Link to this section 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.

Link to this section Types

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

Link to this section Functions

-spec log(Report) -> Result when Report :: map(), Result :: any().
-spec log(Report, Req) -> Result when Report :: map(), Req :: map(), Result :: any().
Link to this function

request(Context, Options)

View Source
-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.