Contains 判断是否包含某个IP
(ipBytes []byte)
| 81 | |
| 82 | // Contains 判断是否包含某个IP |
| 83 | func (this *IPList) Contains(ipBytes []byte) bool { |
| 84 | if this.isDeleted { |
| 85 | return false |
| 86 | } |
| 87 | |
| 88 | this.mu.RLock() |
| 89 | defer this.mu.RUnlock() |
| 90 | |
| 91 | if len(this.allItemsMap) > 0 { |
| 92 | return true |
| 93 | } |
| 94 | |
| 95 | var item = this.lookupIP(ipBytes) |
| 96 | return item != nil |
| 97 | } |
| 98 | |
| 99 | // ContainsExpires 判断是否包含某个IP |
| 100 | func (this *IPList) ContainsExpires(ipBytes []byte) (expiresAt int64, ok bool) { |