aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r--internal/feed/feed.go32
1 files changed, 1 insertions, 31 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index b8a3849..40e385d 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -21,36 +21,6 @@ const (
// TODO: parse cpe
-// CVSS severity
-type Severity int
-
-// Unmarshal CVSS severity from JSON.
-func (me *Severity) UnmarshalJSON(b []byte) error {
- // decode string, check for error
- var s string
- if err := json.Unmarshal(b, &s); err != nil {
- return err
- }
-
- // check value
- switch s {
- case "LOW":
- *me = Low
- case "MEDIUM":
- *me = Medium
- case "HIGH":
- *me = High
- case "CRITICAL":
- *me = Critical
- default:
- // return error
- return fmt.Errorf("unknown severity: %s", s)
- }
-
- // return success
- return nil
-}
-
type V2AccessVector byte
const (
@@ -372,7 +342,7 @@ type CvssV2 struct {
// CVSS V2 base metrics
type BaseMetricV2 struct {
CvssV2 CvssV2 `json:"cvssV2"`
- severity Severity `json:"severity"`
+ Severity Severity `json:"severity"`
ExploitabilityScore Score `json:"impactScore"`
ImpactScore Score `json:"impactScore"`
InsufficientInfo bool `json:"acInsufInfo"`