diff options
Diffstat (limited to 'internal/cvss/cvss.go')
-rw-r--r-- | internal/cvss/cvss.go | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/internal/cvss/cvss.go b/internal/cvss/cvss.go index c56046b..4a1a789 100644 --- a/internal/cvss/cvss.go +++ b/internal/cvss/cvss.go @@ -8,61 +8,6 @@ import ( //go:generate stringer -linecomment -type=v3Key //go:generate stringer -linecomment -type=v3Metric -// CVSS 2.0 vector. -type v2Vector []v2Metric - -// Convert vector to string -func (v v2Vector) String() string { - // convert to slice of metrics - metrics := []v2Metric(v) - - // build vector - r := make([]string, len(metrics)) - for i, m := range(metrics) { - r[i] = m.String() - } - - // build and return string - return strings.Join(r, "/") -} - -// Return CVSS version. -func (v2Vector) Version() Version { - return V20 -} -// Return metrics in this vector. -func (v v2Vector) Metrics() []Metric { - // build result - r := make([]Metric, len(v)) - for i, m := range(v) { - r[i] = m - } - - // return result - return r -} - -// create CVSS 2.0 vector from string -func newV2Vector(s string) (Vector, error) { - strs := strings.Split(s, "/") - r := make([]v2Metric, len(strs)) - - // walk metric strings - for i, ms := range(strs) { - // convert string to vector - m, err := getV2MetricFromString(ms) - if err != nil { - return nil, err - } - - // add to results - r[i] = m - } - - // build and return vector - return v2Vector(r), nil -} - // CVSS v3 metric key type v3Key byte |