class

Analyzer::Go::Hertz

Inherits Analyzer::Go::GoEngine < Analyzer < FileHelper < Reference < Object

Constants

HTTP_METHODS_ALLOWED = (HTTP_METHODS_EXPANDED + (["TRACE", "CONNECT", "QUERY", "ANY"] of ::String)).to_set
HTTP_METHODS_EXPANDED = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"] of ::String

Hertz (https://github.com/cloudwego/hertz) mirrors Gin's routing API: h := server.Default() h.GET("/ping", handler) h.Any("/path", handler) -- expands to all HTTP methods g := h.Group("/api/v1"); g.GET(...) and uses the same parameter accessors on the RequestContext: ctx.Query / DefaultQuery / PostForm / DefaultPostForm / GetHeader / Cookie

IMPORT_MARKER = "github.com/cloudwego/hertz"
PARAM_ACCESSOR_RE = /(?:DefaultQuery|DefaultPostForm|Query|PostForm|GetHeader|Param|FormValue)\s*\(\s*"?([^",\s\)]+)"?/

Regex-based extraction so nested calls (e.g. fmt.Println(ctx.Query("x"))) and whitespace variants still yield the right param name, and so the param-type derivation stays in one place.

Class methods

tech_name
Source

Instance methods

analyze
Source
get_param(line : String) : Param
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