depsdev

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package depsdev provides a vulnerability source backed by Google's deps.dev API.

Index

Constants

View Source
const (
	DefaultAPIURL  = "https://api.deps.dev/v3alpha"
	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 deps.dev API. This is a free API with no authentication required.

func New

func New(opts ...Option) *Source

New creates a new deps.dev source.

func (*Source) Get

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

Get fetches a specific vulnerability by ID (OSV ID).

func (*Source) Name

func (s *Source) Name() string

Name returns "deps.dev".

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.

func (*Source) QueryBatch

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

QueryBatch queries multiple packages at once using the batch endpoint.

Jump to

Keyboard shortcuts

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