Skip to content
Snippets Groups Projects
Commit d2434faa authored by Johannes Barstad's avatar Johannes Barstad
Browse files

more commenting, sufficient

parent 1c443370
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ import (
"github.com/gin-gonic/gin"
)
// Retrieves data of uploaded file
func UploadFileRetrieve(c *gin.Context) {
var fileData []byte
......@@ -77,6 +78,7 @@ func UploadFileRetrieve(c *gin.Context) {
c.Data(http.StatusOK, "application/json", fileData)
}
// Performs request to virustotal, returning a full report of analyzed file
func uploadFileRetrieveCall(id string) (data []byte, err error) {
var responseData utils.ResultFrontendResponse
responseData, err = CallVirusTotal(id)
......@@ -94,6 +96,7 @@ func uploadFileRetrieveCall(id string) (data []byte, err error) {
return fileData, nil
}
// Uploads file to VirusTotal and returns an ID reference to the scan results in VirusTotal
func UploadFile(c *gin.Context) {
log.Println("Fileupload worked")
logging.Loginfo("Fileupload worked")
......
......@@ -118,6 +118,7 @@ func CallVirusTotal(id string) (response utils.ResultFrontendResponse, err error
return response, nil
}
// Sorts frontend display information from AV engines, based on malicious sites first, and harmless last
func sortDanger(values []utils.FrontendResponse2, dangerSize int, safeSize int) []utils.FrontendResponse2 {
if dangerSize == 0 {
return values
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment