osvdev

package
v0.67.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, logger *slog.Logger, sqlDB *sql.DB, pw progress.Writer, httpClient *http.Client) error

Types

type Client

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

func NewClient

func NewClient(httpClient *http.Client) Client

func (*Client) Query

func (c *Client) Query(q Query) (vulns Vulns, err error)

func (*Client) QueryBatch

func (c *Client) QueryBatch(q []Query) ([]Vulns, error)

type OsvDev

type OsvDev struct{}

func (*OsvDev) AnonymiseData

func (*OsvDev) AnonymiseData(ctx context.Context, sqlDB *sql.DB, orgs []string) (err error)

func (*OsvDev) CreateTables

func (*OsvDev) CreateTables(ctx context.Context, sqlDB *sql.DB) error

type Package

type Package struct {
	Name      string `json:"name"`
	Ecosystem string `json:"ecosystem"`
}

type Query

type Query struct {
	Version string  `json:"version"`
	Package Package `json:"package"`
}

type QueryBatchRequest

type QueryBatchRequest struct {
	Queries []Query `json:"queries"`
}

type QueryBatchResponse

type QueryBatchResponse struct {
	Results []struct {
		Vulns []QueryBatchVuln `json:"vulns"`
	} `json:"results"`
}

type QueryBatchVuln

type QueryBatchVuln struct {
	ID string `json:"id"`
}

type QueryResponse

type QueryResponse struct {
	Vulns []Vuln `json:"vulns"`
}

type Vuln

type Vuln struct {
	ID string `json:"id"`
}

func (Vuln) URL

func (v Vuln) URL() string

type Vulns

type Vulns struct {
	Query Query
	Vulns []Vuln
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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