Skip to content

Commit

Permalink
cmd: complete scan command
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptnull committed Oct 18, 2024
1 parent b711916 commit bd369b8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pkg/client/scan.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package client

import (
"net/http"
)

type ScanOpts struct {
ApiHeaders map[string]string
Severity string
}

func Scan(imageName, apiHost string, opts *ScanOpts) error {
// TODO: Complete this function after completing
// https://github.com/gokakashi/goKakashi/issues/22

req, err := http.NewRequest(http.MethodPost, apiHost, nil)
if err != nil {
return err
}

for k, v := range opts.ApiHeaders {
req.Header.Add(k, v)
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()

return nil
}

0 comments on commit bd369b8

Please sign in to comment.