-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b711916
commit bd369b8
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |