MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / ContainsExpires

Method ContainsExpires

internal/iplibrary/ip_list.go:100–119  ·  view source on GitHub ↗

ContainsExpires 判断是否包含某个IP

(ipBytes []byte)

Source from the content-addressed store, hash-verified

98
99// ContainsExpires 判断是否包含某个IP
100func (this *IPList) ContainsExpires(ipBytes []byte) (expiresAt int64, ok bool) {
101 if this.isDeleted {
102 return
103 }
104
105 this.mu.RLock()
106 defer this.mu.RUnlock()
107
108 if len(this.allItemsMap) > 0 {
109 return 0, true
110 }
111
112 var item = this.lookupIP(ipBytes)
113
114 if item == nil {
115 return
116 }
117
118 return item.ExpiredAt, true
119}
120
121// ContainsIPStrings 是否包含一组IP中的任意一个,并返回匹配的第一个Item
122func (this *IPList) ContainsIPStrings(ipStrings []string) (item *IPItem, found bool) {

Callers 1

AllowIPFunction · 0.45

Calls 3

lookupIPMethod · 0.95
RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected