Documentation ¶
Overview ¶
Package pyupio provides an updater for importing pyup vulnerability information.
Index ¶
- func UpdaterSet(_ context.Context) (driver.UpdaterSet, error)
- type Config
- type Option
- type Updater
- func (u *Updater) Configure(ctx context.Context, f driver.ConfigUnmarshaler, c *http.Client) error
- func (u *Updater) Fetch(ctx context.Context, hint driver.Fingerprint) (io.ReadCloser, driver.Fingerprint, error)
- func (*Updater) Name() string
- func (u *Updater) Parse(ctx context.Context, r io.ReadCloser) ([]*claircore.Vulnerability, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdaterSet ¶ added in v0.0.21
func UpdaterSet(_ context.Context) (driver.UpdaterSet, error)
Types ¶
type Config ¶ added in v0.4.2
type Config struct {
URL string `json:"url" yaml:"url"`
}
Config is the configuration for the updater.
By convention, this is in a map called "pyupio".
type Option ¶
Option controls the configuration of an Updater.
func WithClient ¶
WithClient sets the http.Client that the updater should use for requests.
If not passed to NewUpdater, http.DefaultClient will be used.
func WithRepo ¶
func WithRepo(r *claircore.Repository) Option
WithRepo sets the repository information that will be associated with all the vulnerabilities found.
If not passed to NewUpdater, a default Repository will be used.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater reads a pyup formatted json database for vulnerabilities.
The zero value is not safe to use.
func NewUpdater ¶
NewUpdater returns a configured Updater or reports an error.
func (*Updater) Fetch ¶
func (u *Updater) Fetch(ctx context.Context, hint driver.Fingerprint) (io.ReadCloser, driver.Fingerprint, error)
Fetch implements driver.Updater.
func (*Updater) Parse ¶
func (u *Updater) Parse(ctx context.Context, r io.ReadCloser) ([]*claircore.Vulnerability, error)
Parse implements driver.Updater.