diff options
-rw-r--r-- | cisa/catalog.go | 5 | ||||
-rw-r--r-- | cisa/catalog_test.go | 3 | ||||
-rw-r--r-- | rfc3339/date.go (renamed from cisa/date.go) | 4 | ||||
-rw-r--r-- | rfc3339/date_test.go (renamed from cisa/date_test.go) | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/cisa/catalog.go b/cisa/catalog.go index 38116f6..4e9cc1a 100644 --- a/cisa/catalog.go +++ b/cisa/catalog.go @@ -3,6 +3,7 @@ package cisa import ( "time" "github.com/pablotron/cvez/feed" + "github.com/pablotron/cvez/rfc3339" ) // Vulnerability entry. @@ -20,7 +21,7 @@ type Vulnerability struct { Name string `json:"vulnerabilityName"` // Date vulnerability was added to catalog. - DateAdded Date `json:"dateAdded"` + DateAdded rfc3339.Date `json:"dateAdded"` // Short description of vulnerability. ShortDescription string `json:"shortDescription"` @@ -29,7 +30,7 @@ type Vulnerability struct { RequiredAction string `json:"requiredAction"` // Date that required action is due. - DueDate Date `json:"dueDate"` + DueDate rfc3339.Date `json:"dueDate"` } // Known exploited vulnerabilities catalog. diff --git a/cisa/catalog_test.go b/cisa/catalog_test.go index b86d21c..1e4ba7e 100644 --- a/cisa/catalog_test.go +++ b/cisa/catalog_test.go @@ -4,6 +4,7 @@ import ( "compress/gzip" "encoding/json" "github.com/pablotron/cvez/feed" + "github.com/pablotron/cvez/rfc3339" "os" "reflect" "testing" @@ -13,7 +14,7 @@ import ( // catalog test data type catalogTestData struct { CveIds map[string]feed.CveId `json:"cves"` - Dates map[string]Date `json:"dates"` + Dates map[string]rfc3339.Date `json:"dates"` Times map[string]time.Time `json:"times"` } diff --git a/cisa/date.go b/rfc3339/date.go index b3b6528..4f11d03 100644 --- a/cisa/date.go +++ b/rfc3339/date.go @@ -1,4 +1,4 @@ -package cisa +package rfc3339 import ( "encoding/json" @@ -7,7 +7,7 @@ import ( "strconv" ) -// YYYY-MM-DD +// RFC3339 date. type Date uint16 // Returns true if the year is a leap year, and false otherwise. diff --git a/cisa/date_test.go b/rfc3339/date_test.go index 47e152e..ab70377 100644 --- a/cisa/date_test.go +++ b/rfc3339/date_test.go @@ -1,4 +1,4 @@ -package cisa +package rfc3339 import ( "encoding/json" |