modify example & README

This commit is contained in:
edboffical 2022-03-23 21:30:38 +08:00
parent b56ed1c270
commit 0a5f669442
3 changed files with 9 additions and 21 deletions

View File

@ -81,16 +81,12 @@ func main() {
}
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANSIZE, 1024*1024*40)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MAX_FILESIZE, 1024*1024*20)
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANTIME, 9000)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MATCH_LIMIT, 1000)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT, 500)
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT))
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_MAX_SCANSIZE))
// scan
scanned, msg, err := c.ScanFile("./test_file/nmap")
fmt.Println(scanned, msg, err)
scanned, virusName, ret := c.ScanFile("./test_file/nmap")
fmt.Println(scanned, virusName, ret)
}
```

View File

@ -81,16 +81,12 @@ func main() {
}
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANSIZE, 1024*1024*40)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MAX_FILESIZE, 1024*1024*20)
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANTIME, 9000)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MATCH_LIMIT, 1000)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT, 500)
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT))
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_MAX_SCANSIZE))
// scan
scanned, msg, err := c.ScanFile("./test_file/nmap")
fmt.Println(scanned, msg, err)
scanned, virusName, ret := c.ScanFile("./test_file/nmap")
fmt.Println(scanned, virusName, ret)
}
```

View File

@ -38,14 +38,10 @@ func main() {
}
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANSIZE, 1024*1024*40)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MAX_FILESIZE, 1024*1024*20)
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANTIME, 9000)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MATCH_LIMIT, 1000)
c.EngineSetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT, 500)
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT))
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_MAX_SCANSIZE))
// scan
scanned, msg, err := c.ScanFile("./test_file/nmap")
fmt.Println(scanned, msg, err)
scanned, virusName, ret := c.ScanFile("./test_file/nmap")
fmt.Println(scanned, virusName, ret)
}