epss

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 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

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

func FetchData

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

FetchData do a GET request and gunzip on the CSV

func ParseEPSSDataCSV

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

ParseEPSSDataCSV custom CSV parsing function

func WithClient

func WithClient(client *http.Client) fetchOptionFunc

func WithURL

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

func (c CVE) EPSSValue() float64

EPSSValue lazy convert to float

func (CVE) PercentileValue

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

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

FetchOptions optional settings for the request

func DefaultFetchOptions

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