aboutsummaryrefslogtreecommitdiff
path: root/internal/cvss/vector.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-04 00:35:31 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-04 00:35:31 -0500
commit9c17b97cd0f83be3fff9fa4e87fd1d29052ea616 (patch)
tree0d97030a0d0c3ad983be281ce89f80571338887f /internal/cvss/vector.go
parent92400d731546557d110c9c3cc3906d700f83dda8 (diff)
downloadcvez-9c17b97cd0f83be3fff9fa4e87fd1d29052ea616.tar.bz2
cvez-9c17b97cd0f83be3fff9fa4e87fd1d29052ea616.zip
rename to github.com/pablotron/cvez, remove internal libs
Diffstat (limited to 'internal/cvss/vector.go')
-rw-r--r--internal/cvss/vector.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/internal/cvss/vector.go b/internal/cvss/vector.go
deleted file mode 100644
index 3e465c5..0000000
--- a/internal/cvss/vector.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package cvss
-
-import (
- "fmt"
-)
-
-// CVSS metric vector.
-type Vector interface {
- // Get CVSS version.
- Version() Version
-
- // Get CVSS vector string.
- String() string
-
- // Return metrics in this vector.
- Metrics() []Metric
-
- // Unmarshal vector from JSON.
- // UnmarshalJSON(b []byte) error
-}
-
-// Create new CVSS vector from vector string.
-func NewVector(s string) (Vector, error) {
- if isV31VectorString(s) {
- // create CVSS v3.1 vector.
- return newV31Vector(s)
- } else if isV30VectorString(s) {
- // create CVSS v3.0 vector.
- return newV30Vector(s)
- } else if isV2VectorString(s) {
- // create CVSS v2 vector.
- return newV2Vector(s)
- } else {
- return nil, fmt.Errorf("invalid CVSS vector: %s", s)
- }
-}