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

Method Contains

internal/iplibrary/ip_list.go:83–97  ·  view source on GitHub ↗

Contains 判断是否包含某个IP

(ipBytes []byte)

Source from the content-addressed store, hash-verified

81
82// Contains 判断是否包含某个IP
83func (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
100func (this *IPList) ContainsExpires(ipBytes []byte) (expiresAt int64, ok bool) {

Callers

nothing calls this directly

Calls 3

lookupIPMethod · 0.95
RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected