aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-03-15 00:17:07 -0400
committerPaul Duncan <pabs@pablotron.org>2022-03-15 00:17:07 -0400
commita00d4d0fd4c7e9b4e5ecf97e3bb978f680541dba (patch)
treefe3f149cb41b456ead3db929f1b18c54edb1777f
parent3c678605abb7003085652cc2008dd8cbd4e3eec2 (diff)
downloadcvez-a00d4d0fd4c7e9b4e5ecf97e3bb978f680541dba.tar.bz2
cvez-a00d4d0fd4c7e9b4e5ecf97e3bb978f680541dba.zip
move cisa/date.go to rfc3339/date.go
-rw-r--r--cisa/catalog.go5
-rw-r--r--cisa/catalog_test.go3
-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"