aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-01 01:21:45 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-01 01:21:45 -0500
commit07390eeb960df3ca10b758c9f62459cf2ee9aa3f (patch)
tree6612ba4fe2f7252a3096bc2bb250aca11d86636f /internal/feed/feed.go
parenta824a9732154f9bee2ce530f753d5747de78aa3f (diff)
downloadcvez-07390eeb960df3ca10b758c9f62459cf2ee9aa3f.tar.bz2
cvez-07390eeb960df3ca10b758c9f62459cf2ee9aa3f.zip
add internal/feed/dataformat.go
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r--internal/feed/feed.go27
1 files changed, 1 insertions, 26 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index b4d514b..a43b7e9 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -9,8 +9,7 @@ import (
)
const (
- MitreFormat = iota // MITRE data format
- DataVersion40 // Version 4.0
+ DataVersion40 = iota // Version 4.0
OrNodeOp // OR operator
AndNodeOp // And operator
@@ -43,30 +42,6 @@ const (
// TODO: parse cpe
-// Data format for NVD feeds and feed items.
-type DataFormat int
-
-// Unmarshal DataFormat from JSON.
-func (me *DataFormat) 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 "MITRE":
- *me = MitreFormat
- default:
- // return error
- return fmt.Errorf("unknown data format: %s", s)
- }
-
- // return success
- return nil
-}
-
// Data version for NVD feeds and feed items.
type DataVersion int