2023-04-06 09:35:59 +00:00
|
|
|
package main
|
2023-04-07 11:57:58 +00:00
|
|
|
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
|
|
|
|
type status_response struct {
|
|
|
|
cvdVersion int `json:"cvd_version"`
|
|
|
|
sanity_check bool `json:"sanity_check"`
|
|
|
|
scanning_engine string `json:"scanning_engine"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type scan_response struct {
|
|
|
|
malware_detected bool `json:"malware_detected"`
|
|
|
|
malware_name string `json:"malware_name"`
|
|
|
|
engine status_response `json:"engine"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func scan_api(c *gin.Context) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func status_api(c *gin.Context) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func start_api() {
|
|
|
|
//gin.SetMode(gin.ReleaseMode)
|
|
|
|
|
|
|
|
router := gin.Default()
|
|
|
|
router.PUT("/scan", scan_api)
|
|
|
|
router.GET("/status", status_api)
|
|
|
|
|
|
|
|
router.Run(":8080")
|
|
|
|
}
|