class

Analyzer::Go::Iris

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

Constants

HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]
IMPORT_MARKER = "github.com/kataras/iris"
IMPORT_MARKER_RE = Regex.union(IMPORT_MARKER)

One precompiled matcher instead of a String#includes? scan per .go file: includes? runs Rabin-Karp over the whole buffer and the marker is absent in the overwhelming majority of files in a polyglot repo, so every one of them pays the full scan. See Analyzer#content_matches?.

Class methods

tech_name
Source

Instance methods

analyze
Source
get_param(line : String, pattern : String) : Param
Source
normalize_iris_path(path : String) : String

Strip Iris type annotations from path params: {id:uint64} → {id}, {file:path} → {file}. Leaves unadorned {id} untouched.

Source
split_iris_subdomain(path : String) : Tuple(String | Nil, String)

Iris route paths always start with /; a Party prefix that does NOT (e.g. admin., www., v1.) is a subdomain, which the group resolver concatenates into a malformed admin./settings. Split the leading dotted host segment off so the path is clean and the host is carried separately. Returns {subdomain?, clean_path}.

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