class

Analyzer::Go::Gin

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

Constants

BIND_CALL = /\.(?:Must|Should)?Bind(JSON|Query|Header|Uri|With|BodyWith|BodyWithJSON)?\s*\(\s*&?\s*([A-Za-z_]\w*)\s*(?:,\s*binding\.(\w+)\s*)?\)/

c.ShouldBindJSON(&req), c.MustBindWith(params, binding.Query).

BIND_KIND_TAGS = {"default" => ["json", "form"] of ::String, "json" => ["json"] of ::String, "query" => ["form"] of ::String, "form" => ["form"] of ::String, "uri" => ["uri"] of ::String, "header" => ["header"] of ::String}

The struct tags each binder reads.

BIND_LINE = /\.(?:Must|Should)?Bind(?:JSON|XML|YAML|TOML|Query|Header|Uri|With|BodyWith|BodyWithJSON)?\s*\(/
BINDING_KINDS = {"JSON" => "json", "Query" => "query", "Form" => "form", "FormPost" => "form", "FormMultipart" => "form", "Uri" => "uri", "Header" => "header"}

The binder a binding.X argument names.

BUILDER_TYPE = "*gin.RouterGroup"
IMPORT_MARKER = "github.com/gin-gonic/gin"
TAG_KEYS = (["json", "form", "uri", "header"] of ::String).to_h do |key| {key, /(?:\A|\s)#{key}:"/} end

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