epss

package
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadData added in v0.7.0

func DownloadData(w io.Writer, optionFuncs ...fetchOptionFunc) error

func FetchData added in v0.7.0

func FetchData(destData *Data, optionFuncs ...fetchOptionFunc) error

FetchData do a GET request and gunzip on the CSV

func ParseEPSSDataCSV added in v0.7.0

func ParseEPSSDataCSV(r io.Reader, data *Data) error

ParseEPSSDataCSV custom CSV parsing function

func WithClient added in v0.7.0

func WithClient(client *http.Client) fetchOptionFunc

func WithURL added in v0.7.0

func WithURL(url string) fetchOptionFunc

Types

type CVE

type CVE struct {
	EPSS       string
	Percentile string
}

CVE represents a row in the CSV data

Values can be converted lazily to a float on read

func (CVE) EPSSValue added in v0.7.0

func (c CVE) EPSSValue() float64

EPSSValue lazy convert to float

func (CVE) PercentileValue added in v0.7.0

func (c CVE) PercentileValue() float64

PercentileValue lazy convert to float

type Data

type Data struct {
	ModelVersion string
	ScoreDate    time.Time
	CVEs         map[string]CVE
}

Data a representation of the CSV data from first API

type FetchOptions added in v0.7.0

type FetchOptions struct {
	Client *http.Client
	URL    string
}

FetchOptions optional settings for the request

func DefaultFetchOptions added in v0.7.0

func DefaultFetchOptions() *FetchOptions

DefaultFetchOptions use the default client and url for today's scores

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL