small bug fix
This commit is contained in:
parent
9b4adfe863
commit
8e361f3156
1 changed files with 4 additions and 4 deletions
|
|
@ -28,21 +28,21 @@ func NewMemBlacklist() *MemBlacklist {
|
|||
}
|
||||
|
||||
// Add adds a new token signature with expiration time to the blacklist
|
||||
func (mb MemBlacklist) Add(sig string, exp int64) {
|
||||
func (mb *MemBlacklist) Add(sig string, exp int64) {
|
||||
mb.Lock()
|
||||
mb.list[sig] = exp
|
||||
mb.Unlock()
|
||||
}
|
||||
|
||||
// Remove deletes a token signature from the blacklist
|
||||
func (mb MemBlacklist) Remove(sig string) {
|
||||
func (mb *MemBlacklist) Remove(sig string) {
|
||||
mb.Lock()
|
||||
delete(mb.list, sig)
|
||||
mb.Unlock()
|
||||
}
|
||||
|
||||
// Check returns true if a token signature is blacklisted and false otherwise
|
||||
func (mb MemBlacklist) Check(sig string) (ok bool) {
|
||||
func (mb *MemBlacklist) Check(sig string) (ok bool) {
|
||||
mb.RLock()
|
||||
_, ok = mb.list[sig]
|
||||
mb.RUnlock()
|
||||
|
|
@ -50,7 +50,7 @@ func (mb MemBlacklist) Check(sig string) (ok bool) {
|
|||
}
|
||||
|
||||
// Map returns the blacklist in the form of a iterable map structure for cleanup
|
||||
func (mb MemBlacklist) Map() (list BlacklistMap) {
|
||||
func (mb *MemBlacklist) Map() (list BlacklistMap) {
|
||||
list = make(BlacklistMap)
|
||||
mb.RLock()
|
||||
for k, v := range mb.list {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue