MCPcopy Create free account
hub / github.com/astercloud/aster / get

Method get

pkg/security/access_control.go:1029–1039  ·  view source on GitHub ↗

AccessCache 缓存方法

(key string)

Source from the content-addressed store, hash-verified

1027
1028// AccessCache 缓存方法
1029func (cache *AccessCache) get(key string) *CacheEntry {
1030 cache.mu.RLock()
1031 defer cache.mu.RUnlock()
1032
1033 entry, exists := cache.entries[key]
1034 if !exists || time.Now().After(entry.expiredAt) {
1035 return nil
1036 }
1037
1038 return entry
1039}
1040
1041func (cache *AccessCache) set(key string, decision *AccessDecision, ttl time.Duration) {
1042 cache.mu.Lock()

Callers 1

CheckPermissionMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected