MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / parseURLPatterns

Function parseURLPatterns

env/parsers.go:182–191  ·  view source on GitHub ↗

parseURLPatterns parses a comma-separated list of wildcard patterns and converts them to compiled regular expressions using RegexpFromPattern.

(env string)

Source from the content-addressed store, hash-verified

180// parseURLPatterns parses a comma-separated list of wildcard patterns and converts them
181// to compiled regular expressions using RegexpFromPattern.
182func parseURLPatterns(env string) ([]*regexp.Regexp, error) {
183 parts := strings.Split(env, ",")
184 result := make([]*regexp.Regexp, len(parts))
185
186 for i, p := range parts {
187 result[i] = RegexpFromPattern(strings.TrimSpace(p))
188 }
189
190 return result, nil
191}
192
193// parseHexSlice parses a comma-separated list of hex-encoded strings and returns
194// a slice of byte slices.

Callers

nothing calls this directly

Calls 2

RegexpFromPatternFunction · 0.85
SplitMethod · 0.80

Tested by

no test coverage detected