MCPcopy Index your code
hub / github.com/apache/casbin / GetCacheKey

Function GetCacheKey

enforcer_cached.go:160–174  ·  view source on GitHub ↗
(params ...interface{})

Source from the content-addressed store, hash-verified

158}
159
160func GetCacheKey(params ...interface{}) (string, bool) {
161 key := strings.Builder{}
162 for _, param := range params {
163 switch typedParam := param.(type) {
164 case string:
165 key.WriteString(typedParam)
166 case CacheableParam:
167 key.WriteString(typedParam.GetCacheKey())
168 default:
169 return "", false
170 }
171 key.WriteString("$$")
172 }
173 return key.String(), true
174}
175
176// ClearPolicy clears all policy.
177func (e *CachedEnforcer) ClearPolicy() {

Callers 2

getKeyMethod · 0.85
getKeyMethod · 0.85

Calls 2

GetCacheKeyMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…