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

Method checkOneAndRemoveCache

enforcer_cached_synced.go:152–162  ·  view source on GitHub ↗
(params ...interface{})

Source from the content-addressed store, hash-verified

150}
151
152func (e *SyncedCachedEnforcer) checkOneAndRemoveCache(params ...interface{}) (bool, error) {
153 if atomic.LoadInt32(&e.enableCache) != 0 {
154 key, ok := e.getKey(params...)
155 if ok {
156 if err := e.cache.Delete(key); err != nil && err != cache.ErrNoSuchKey {
157 return false, err
158 }
159 }
160 }
161 return true, nil
162}
163
164func (e *SyncedCachedEnforcer) checkManyAndRemoveCache(rules [][]string) (bool, error) {
165 if len(rules) != 0 {

Callers 2

AddPolicyMethod · 0.95
RemovePolicyMethod · 0.95

Calls 2

getKeyMethod · 0.95
DeleteMethod · 0.65

Tested by

no test coverage detected