Documentation
¶
Overview ¶
Package osv provides a vulnerability source backed by the OSV API.
Index ¶
- Constants
- type Option
- type Source
- func (s *Source) Get(ctx context.Context, id string) (*vulns.Vulnerability, error)
- func (s *Source) Name() string
- func (s *Source) Query(ctx context.Context, p *purl.PURL) ([]vulns.Vulnerability, error)
- func (s *Source) QueryBatch(ctx context.Context, purls []*purl.PURL) ([][]vulns.Vulnerability, error)
Constants ¶
View Source
const ( DefaultAPIURL = "https://api.osv.dev/v1" 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 WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithUserAgent ¶ added in v0.1.2
WithUserAgent sets the User-Agent header for API requests.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source implements vulns.Source using the OSV API.
func (*Source) QueryBatch ¶
func (s *Source) QueryBatch(ctx context.Context, purls []*purl.PURL) ([][]vulns.Vulnerability, error)
QueryBatch queries multiple packages at once.
Click to show internal directories.
Click to hide internal directories.