Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BaseURL string ClientConfig client.Config // contains filtered or unexported fields }
Config is used to configure the execution of the converter
type Convertible ¶
type Convertible interface { // ID should return vulnerabilities ID ID() string // Convert should return a new CVE Item, or an error if it's not possible Convert() (*nvd.NVDCVEFeedJSON10DefCVEItem, error) }
Convertible is any struct which knows how to convert itself to NVD CVE Item
type FetchSince ¶
type FetchSince func(ctx context.Context, c client.Client, baseURL string, since int64) (<-chan Convertible, error)
FetchSince knows how to fetch vulnerabilities from an API it should create a new channel, fetch everything concurrently and close the channel
type Read ¶
type Read func(io.Reader, chan Convertible) error
Read should read the vulnerabilities from the given reader and push them into the channel The contents of the reader should be a slice of structs which are convertibles channel will be created and mustn't be closed
type Runner ¶
type Runner struct { Config FetchSince Read }
Runner knows how to run everything together, based on the config values if config.Download is set, it will use the fetcher, otherwise it will use Reader to read stdin or files