go format
This commit is contained in:
parent
4ee3a0be1a
commit
cc8246c222
18 changed files with 207 additions and 217 deletions
|
@ -78,5 +78,4 @@ func GetAllFiles() ([]sqlc.File, error) {
|
|||
}
|
||||
return files, err
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ type olevbaResponse struct {
|
|||
Stomping bool `json:"stomping"`
|
||||
}
|
||||
|
||||
|
||||
func OleVBAScan(fileID pgtype.UUID) (olevbaResponse, error) {
|
||||
slog.Debug("Starting OLEvba scan", "file-uuid", fileID.String())
|
||||
oleidUrl, err := url.Parse(viper.GetString("processing.oleurl"))
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
|
||||
func TestOleVba(t *testing.T) {
|
||||
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug})))
|
||||
viper.Set("processing.oleurl", "http://localhost:5000")
|
||||
|
|
|
@ -27,6 +27,5 @@ func YaraProcessing(job sqlc.ProcessingJob) error {
|
|||
return err
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -27,11 +27,10 @@ func GetFileType(fileId string) (string, error) {
|
|||
|
||||
// Returns the MimeType for a []byte
|
||||
// Only pass the necessary data!
|
||||
func GetBytesFileType(data []byte) (string) {
|
||||
func GetBytesFileType(data []byte) string {
|
||||
mimetype.SetLimit(uint32(viper.GetSizeInBytes("processing.maxmimesize")))
|
||||
mtype := mimetype.Detect(data)
|
||||
slog.Debug("GetBytesFileType", "file-mime", mtype.String())
|
||||
|
||||
|
||||
return mtype.String()
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ func setconf() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
func TestFileType(t *testing.T) {
|
||||
err := setconf()
|
||||
if err != nil {
|
||||
|
|
|
@ -7,8 +7,6 @@ import (
|
|||
"git.jmbit.de/jmb/scanfile/server/internal/database"
|
||||
)
|
||||
|
||||
|
||||
|
||||
func AdminWebHandler(w http.ResponseWriter, r *http.Request) {
|
||||
jobs, err := database.ALlProcessingJobs()
|
||||
if err != nil {
|
||||
|
@ -23,5 +21,3 @@ func AdminWebHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue