class

Analyzer::C::Civetweb

Inherits CEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

CivetWeb. Handlers are registered per URI pattern:

mg_set_request_handler(ctx, "/api/items", ItemsHandler, 0);
mg_set_websocket_handler(ctx, "/ws", connect, ready, data, close, 0);
server.addHandler("/a", h_a);              // C++ CivetServer wrapper

A C handler is one function for every method, so the methods are the ones it compares request_method against (GET if it never does). A C++ handler is a CivetHandler subclass whose handleGet/handlePost/... overrides are the methods (handleAll alone serves them all).

Constants

ALL_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH"] of ::String
HANDLE_METHOD_RE = /\bhandle(Get|Post|Put|Delete|Patch|Head|Options)\s*\(/
REGISTER_RE = /\b(mg_set_request_handler|mg_set_websocket_handler(?:_with_subprotocols)?|addHandler|addWebSocketHandler)\s*\(/

Class methods

tech_name
Source

Instance methods

analyze_file(path : String) : Array(Endpoint)
Source
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.

Source