diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-02-01 01:34:04 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-02-01 01:34:04 -0500 |
commit | b21b93ddda2f94d38c62d2c8aacc3b4b193c7742 (patch) | |
tree | 5926d31d5cebec611f717f61edeb28460130aff4 /internal | |
parent | 07390eeb960df3ca10b758c9f62459cf2ee9aa3f (diff) | |
download | cvez-b21b93ddda2f94d38c62d2c8aacc3b4b193c7742.tar.bz2 cvez-b21b93ddda2f94d38c62d2c8aacc3b4b193c7742.zip |
add internal/feed/dataversion*go
Diffstat (limited to 'internal')
-rw-r--r-- | internal/feed/feed.go | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go index a43b7e9..c013877 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -9,9 +9,7 @@ import ( ) const ( - DataVersion40 = iota // Version 4.0 - - OrNodeOp // OR operator + OrNodeOp = iota // OR operator AndNodeOp // And operator AdjacentNetwork // Adjacent Network attack vector. @@ -42,30 +40,6 @@ const ( // TODO: parse cpe -// Data version for NVD feeds and feed items. -type DataVersion int - -// Unmarshal DataVersion from JSON. -func (me *DataVersion) 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 "4.0": - *me = DataVersion40 - default: - // return error - return fmt.Errorf("unknown data version: %s", s) - } - - // return success - return nil -} - // partial timestamp type PartialTime time.Time |