vl

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package vl provides a vulnerability source backed by vulnerability-lookup.org (CIRCL).

Index

Constants

View Source
const (
	DefaultAPIURL  = "https://vulnerability.circl.lu/api"
	DefaultTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Source)

Option configures a Source.

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL sets a custom API base URL.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets a custom HTTP client.

type Source

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

Source implements vulns.Source using the vulnerability-lookup API.

func New

func New(opts ...Option) *Source

New creates a new vulnerability-lookup source.

func (*Source) Get

func (s *Source) Get(ctx context.Context, id string) (*vulns.Vulnerability, error)

Get fetches a specific vulnerability by ID.

func (*Source) Name

func (s *Source) Name() string

Name returns "vulnerability-lookup".

func (*Source) Query

func (s *Source) Query(ctx context.Context, p *purl.PURL) ([]vulns.Vulnerability, error)

Query returns vulnerabilities affecting the package identified by the PURL. Note: vulnerability-lookup uses vendor/product search, so this maps the PURL to vendor/product as best as possible.

func (*Source) QueryBatch

func (s *Source) QueryBatch(ctx context.Context, purls []*purl.PURL) ([][]vulns.Vulnerability, error)

QueryBatch queries multiple packages. Vulnerability-lookup doesn't have a batch API, so this makes individual requests.

Jump to

Keyboard shortcuts

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