Created
August 26, 2018 08:27
-
-
Save vincent6767/09556c0a02b737eab8ef4097b29784dc to your computer and use it in GitHub Desktop.
Mutex: Cache Invalidation example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
“sync" | |
) | |
// TokenRevocationRecord represents the token revocation list record | |
type TokenRevocationRecord struct {} | |
// TokenRevocationListCache | |
type TokenRevocationListCache struct { | |
TokenRevocationList map[string]TokenRevocationRecord | |
sync.Mutex | |
} | |
func (c *TokenRevocationListCache) UpdateCache() error { | |
c.Lock() | |
defer c.Unlock() | |
// update the cache. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment