Documentation
¶
Index ¶
Constants ¶
const ( EXACT = "exact" GLOB = "glob" REGEXP = "regexp" )
const ( // DefaultGlobCacheSize is the default maximum number of compiled glob patterns to cache. // This limit prevents memory exhaustion from untrusted RBAC patterns. // 10,000 patterns should be sufficient for most deployments while limiting // memory usage to roughly ~10MB (assuming ~1KB per compiled pattern). DefaultGlobCacheSize = 10000 )
Variables ¶
This section is empty.
Functions ¶
func Match ¶
Match tries to match a text with a given glob pattern. Compiled glob patterns are cached for performance.
func MatchStringInList ¶
MatchStringInList will return true if item is contained in list. patternMatch; can be set to exact, glob, regexp. If patternMatch; is set to exact, the item must be an exact match. If patternMatch; is set to glob, the item must match a glob pattern. If patternMatch; is set to regexp, the item must match a regular expression or glob.
func MatchWithError ¶
MatchWithError tries to match a text with a given glob pattern. Returns error if the glob pattern fails to compile. Compiled glob patterns are cached for performance.
func SetCacheSize ¶
func SetCacheSize(maxEntries int)
SetCacheSize reinitializes the glob cache with the given maximum number of entries. This should be called early during process startup, before concurrent access begins.
Types ¶
This section is empty.