api

package
v0.0.0-...-e85a4bd Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Client
	// contains filtered or unexported fields
}

Client stores information needed to access API API key will be sent in the Authorization field rate limiter is used to enforce their api limits (so we don't go over them)

func NewClient

func NewClient(c client.Client, baseURL, apiKey string) *Client

NewClient creates a new Client object with given properties

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, identifier string) (*schema.Advisory, error)

Fetch will return a channel with only one advisory in it

func (*Client) FetchAllVulnerabilities

func (c *Client) FetchAllVulnerabilities(ctx context.Context, since int64) (<-chan runner.Convertible, error)

FetchAllVulnerabilities will fetch all advisories since given time we first fetch all pages and just collect all identifiers found on them and push them into the `identifiers` channel. Then we start fetchers which take those identifiers and fetch the real advisories

Jump to

Keyboard shortcuts

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