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

Function init

internal/waf/ip_list.go:34–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32const IPTypeAll = "*"
33
34func init() {
35 if !teaconst.IsMain {
36 return
37 }
38
39 var cacheFile = Tea.Root + "/data/waf_white_list.cache"
40
41 // save
42 events.On(events.EventTerminated, func() {
43 _ = SharedIPWhiteList.Save(cacheFile)
44 })
45
46 // load
47 go func() {
48 if !Tea.IsTesting() {
49 _ = SharedIPWhiteList.Load(cacheFile)
50 _ = os.Remove(cacheFile)
51 }
52 }()
53}
54
55// IPList IP列表管理
56type IPList struct {

Callers

nothing calls this directly

Calls 4

OnFunction · 0.92
RemoveMethod · 0.65
SaveMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected