pyupio

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package pyupio provides an updater for importing pyup vulnerability information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdaterSet

func UpdaterSet(_ context.Context) (driver.UpdaterSet, error)

Types

type Config

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

type Option func(*Updater) error

Option controls the configuration of an Updater.

func WithClient

func WithClient(c *http.Client) Option

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.

func WithURL

func WithURL(uri string) Option

WithURL sets the URL the updater should fetch.

The URL should point to a gzip compressed tarball containing a properly formatted json object in a file named `insecure_full.json`.

If not passed to NewUpdater, the master branch of github.com/pyupio/safety-db will be fetched.

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

func NewUpdater(opt ...Option) (*Updater, error)

NewUpdater returns a configured Updater or reports an error.

func (*Updater) Configure

func (u *Updater) Configure(ctx context.Context, f driver.ConfigUnmarshaler, c *http.Client) error

Configure implements driver.Configurable.

func (*Updater) Fetch

Fetch implements driver.Updater.

func (*Updater) Name

func (*Updater) Name() string

Name implements driver.Updater.

func (*Updater) Parse

Parse implements driver.Updater.

Jump to

Keyboard shortcuts

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