Documentation
¶
Overview ¶
Package client provides an interface for accessing vulnerability databases, via either HTTP or local filesystem access.
The protocol is described at https://go.dev/security/vuln/database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ByModule returns the entries that affect the given module path. // It returns (nil, nil) if there are none. ByModule(context.Context, string) ([]*osv.Entry, error) // LastModifiedTime returns the time that the database was last modified. // It can be used by tools that periodically check for vulnerabilities // to avoid repeating work. LastModifiedTime(context.Context) (time.Time, error) }
Client interface for fetching vulnerabilities based on module path or ID.
func NewClient ¶
NewClient returns a client that reads the vulnerability database in source (an "http" or "file" prefixed URL).
It currently supports database sources in both the v1 and legacy formats, preferring the v1 format if both are implemented. Support for the legacy database format will be removed soon.
Click to show internal directories.
Click to hide internal directories.