Documentation ¶
Index ¶
- Constants
- Variables
- func Date(year int, month time.Month, day int) time.Time
- func DateFromString(input string) (time.Time, error)
- func DateFromStringOrNow(input string) time.Time
- func DateToString(input time.Time) string
- func IsValidCveID(input string) error
- func IsValidCveList(input []string) error
- func IsValidDate(input time.Time) bool
- func IsValidOutput(input string) bool
- type APIResult
- type APIResultWithHistory
- type APIScore
- type APIScoreData
- type APIScoreWithHistory
- type OrderType
- type Reply
- type ReplyMetadata
- type ReplyType
- type Result
- type ResultWithHistory
- type Score
- type ScoreData
- type ScoreWithHistory
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 DateFromStringOrNow ¶
func DateToString ¶
func IsValidCveID ¶
func IsValidCveList ¶
func IsValidDate ¶
func IsValidOutput ¶
Types ¶
type APIResultWithHistory ¶
type APIResultWithHistory struct { Reply Data []*APIScoreWithHistory `json:"data"` }
type APIScore ¶
type APIScore struct { APIScoreData CVE string `json:"cve"` }
type APIScoreData ¶
type APIScoreWithHistory ¶
type APIScoreWithHistory struct { APIScore TimeSeries []APIScoreData `json:"time-series,omitempty"` }
type Reply ¶
type Reply struct {
*ReplyMetadata
}
func (*Reply) Metadata ¶
func (ref *Reply) Metadata() *ReplyMetadata
type ReplyMetadata ¶
type ReplyType ¶
type ReplyType interface {
Metadata() *ReplyMetadata
}
type ResultWithHistory ¶
type ResultWithHistory struct { Reply Data []*ScoreWithHistory `json:"data"` }
func NewResultWithHistory ¶
func NewResultWithHistory(input *APIResultWithHistory) (*ResultWithHistory, error)
type Score ¶
func (*Score) MarshalJSON ¶
type ScoreData ¶
type ScoreData struct { Date time.Time `json:"date"` EPSS float64 `json:"epss"` Percentile float64 `json:"percentile"` }
func (*ScoreData) MarshalJSON ¶
type ScoreWithHistory ¶
func (*ScoreWithHistory) MarshalJSON ¶
func (ref *ScoreWithHistory) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.