MCPcopy Index your code
hub / github.com/coder/coder / Int

Method Int

coderd/httpapi/queryparams.go:74–83  ·  view source on GitHub ↗
(vals url.Values, def int, queryParam string)

Source from the content-addressed store, hash-verified

72}
73
74func (p *QueryParamParser) Int(vals url.Values, def int, queryParam string) int {
75 v, err := parseQueryParam(p, vals, strconv.Atoi, def, queryParam)
76 if err != nil {
77 p.Errors = append(p.Errors, codersdk.ValidationError{
78 Field: queryParam,
79 Detail: fmt.Sprintf("Query param %q must be a valid integer: %s", queryParam, err.Error()),
80 })
81 }
82 return v
83}
84
85func (p *QueryParamParser) Int64(vals url.Values, def int64, queryParam string) int64 {
86 v, err := parseQueryParam(p, vals, func(v string) (int64, error) {

Callers 15

returnDAUsInternalMethod · 0.95
chatCostUsersMethod · 0.95
FilterFunction · 0.80
AuthorizeMethod · 0.80
PrepareMethod · 0.80
CompileToSQLMethod · 0.80
rbacTraceAttributesFunction · 0.80
hasEmptyResponseFunction · 0.80
EndHTTPSpanFunction · 0.80
acquireAndRunOneMethod · 0.80
BenchmarkStringBigint20Function · 0.80

Calls 2

parseQueryParamFunction · 0.85
ErrorMethod · 0.45