class

Analyzer::Go::Echo

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

Constants

ACCESSOR_RE = /\b(QueryParam|FormValue|Param)\s*\(([^()]*)\)/
ACCESSOR_TYPES = {"QueryParam" => "query", "FormValue" => "form", "Param" => "path"}
BIND_ANY = /\.Bind(?:Body|JSON|XML|YAML|Headers|Query|Path)?\s*\(/
BIND_CALL = /\.Bind\s*\(\s*&?\s*([A-Za-z_]\w*)\s*\)/

c.Bind(&req), or c.Bind(req) with req already a pointer: Echo's DefaultBinder.

BIND_TAGS = ["param", "query", "json", "form"] of ::String
BUILDER_TYPE = "*echo.Group"
FORM_BODY_METHODS = ["POST", "PUT", "PATCH"] of ::String
IMPORT_MARKER = "github.com/labstack/echo"
METHOD_CALL = /\b([A-Za-z_]\w*)\.([A-Za-z_]\w*)\s*\(/
METHOD_RECEIVER = /\Afunc\s*\(\s*(\w+)\s+\*?(\w+)\s*\)/

func (r *loginRequest) bind(c echo.Context, ...) error {: a method that may bind its receiver. func (r *loginRequest) bind(...): the receiver name and type of a method declaration.

NO_BODY_METHODS = ["GET", "HEAD"] of ::String
QUERY_BIND_METHODS = ["GET", "DELETE", "HEAD"] of ::String

Class methods

tech_name
Source

Instance methods

analyze
Source
get_param(line : String) : Param

The accessor's own argument, so one nested in another call (c.String(200, c.QueryParam("color"))) still resolves. c.Param("id") is Echo's path-variable accessor (:id segments).

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