epss

package
v0.0.0-...-47a5711 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APITimeout = 20
	PageSize   = uint64(100)
)
View Source
const (
	OutJSON = "application/json"
	OutYAML = "application/yaml"
	OutXML  = "application/xml"
	OutCSV  = "application/csv"
)
View Source
const (
	NoOrder             = ""
	ScoreDescOrder      = "ot.score.desc"
	ScoreAscOrder       = "ot.score.asc"
	PercentileDescOrder = "ot.percentile.desc"
	PercentileAscOrder  = "ot.percentile.asc"
)

Variables

View Source
var (
	ErrInvalidParams    = errors.New("invalid params")
	ErrInvalidDateParam = errors.New("invalid date param")
	ErrInvalidCVEParam  = errors.New("invalid CVE param")
	ErrNotFound         = errors.New("not found")
	ErrNotAuthorized    = errors.New("not authorized")
	ErrTooManyCVEs      = errors.New("too many CVEs")
)
View Source
var EarliestDate = Date(2021, 4, 14)

Functions

func Date

func Date(year int, month time.Month, day int) time.Time

func DateFromString

func DateFromString(input string) (time.Time, error)

func DateFromStringOrNow

func DateFromStringOrNow(input string) time.Time

func DateToString

func DateToString(input time.Time) string

func IsValidCveID

func IsValidCveID(input string) error

func IsValidCveList

func IsValidCveList(input []string) error

func IsValidDate

func IsValidDate(input time.Time) bool

func IsValidOutput

func IsValidOutput(input string) bool

Types

type APIResult

type APIResult struct {
	Reply
	Data []*APIScore `json:"data"`
}

type APIResultWithHistory

type APIResultWithHistory struct {
	Reply
	Data []*APIScoreWithHistory `json:"data"`
}

type APIScore

type APIScore struct {
	APIScoreData
	CVE string `json:"cve"`
}

type APIScoreData

type APIScoreData struct {
	Date       string `json:"date"`
	EPSS       string `json:"epss"`
	Percentile string `json:"percentile"`
}

type APIScoreWithHistory

type APIScoreWithHistory struct {
	APIScore
	TimeSeries []APIScoreData `json:"time-series,omitempty"`
}

type OrderType

type OrderType string

type Reply

type Reply struct {
	*ReplyMetadata
}

func (*Reply) Metadata

func (ref *Reply) Metadata() *ReplyMetadata

type ReplyMetadata

type ReplyMetadata struct {
	Status     string `json:"status"`
	StatusCode int    `json:"status-code"`
	Version    string `json:"version"`
	Access     string `json:"access"`
	Total      uint64 `json:"total"`
	Offset     uint64 `json:"offset"`
	Limit      uint64 `json:"limit"`
}

type ReplyType

type ReplyType interface {
	Metadata() *ReplyMetadata
}

type Result

type Result struct {
	Reply
	Data []*Score `json:"data"`
}

func NewResult

func NewResult(input *APIResult) (*Result, error)

type ResultWithHistory

type ResultWithHistory struct {
	Reply
	Data []*ScoreWithHistory `json:"data"`
}

func NewResultWithHistory

func NewResultWithHistory(input *APIResultWithHistory) (*ResultWithHistory, error)

type Score

type Score struct {
	ScoreData
	CVE string `json:"cve"`
}

func (*Score) MarshalJSON

func (ref *Score) MarshalJSON() ([]byte, error)

type ScoreData

type ScoreData struct {
	Date       time.Time `json:"date"`
	EPSS       float64   `json:"epss"`
	Percentile float64   `json:"percentile"`
}

func (*ScoreData) MarshalJSON

func (ref *ScoreData) MarshalJSON() ([]byte, error)

type ScoreWithHistory

type ScoreWithHistory struct {
	Score
	History []ScoreData `json:"history,omitempty"`
}

func (*ScoreWithHistory) MarshalJSON

func (ref *ScoreWithHistory) MarshalJSON() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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