Analyzer::C::Mongoose
Inherits CEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object
Cesanta Mongoose. One event handler serves every request and routes by comparing the URI inside it:
if (mg_match(hm->uri, mg_str("/api/login"), NULL)) { ... } // 7.12+
else if (mg_http_match_uri(hm, "/api/#")) { ... } // 7.x
if (mg_vcmp(&hm->uri, "/api/sum") == 0) { ... } // 6.x
mg_register_http_endpoint(c, "/api/v1/sum", handle_sum); // 6.x
The method comes from the same if condition, else from the branch
body, else GET. Params are read from the branch body and the same-file
helpers it calls.
Constants
ROUTE_CALL_RE = /\bmg_(http_match_uri|register_http_endpoint|match|strcmp|vcmp|vcasecmp|globmatch)\s*\(/
Class methods
tech_name
SourceInstance methods
tech
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.