MCPcopy Create free account
hub / github.com/kataras/iris / MatchFilename

Method MatchFilename

context/handler.go:97–103  ·  view source on GitHub ↗

MatchFilename reports whether "filename" contains the "literal".

(filename string)

Source from the content-addressed store, hash-verified

95
96// MatchFilename reports whether "filename" contains the "literal".
97func (expr *NameExpr) MatchFilename(filename string) bool {
98 if filename == "" {
99 return false
100 }
101
102 return strings.Contains(filename, expr.normalizedLiteral)
103}
104
105// The regular expression to match the versioning and the domain part
106var trimFileModuleNameRegex = regexp.MustCompile(`^[\w.]+/(kataras|iris-contrib)/|/v\d+|\.\*`)

Callers 1

HandlerNameFunction · 0.80

Calls 1

ContainsMethod · 0.80

Tested by

no test coverage detected