Documentation
¶
Overview ¶
Package osvdev contains bindings to the osv.dev API
Index ¶
- Constants
- type ClientConfig
- type OSVClient
- func (c *OSVClient) ExperimentalDetermineVersion(ctx context.Context, query *api.DetermineVersionParameters) (*api.VersionMatchList, error)
- func (c *OSVClient) GetVulnByID(ctx context.Context, id string) (*osvschema.Vulnerability, error)
- func (c *OSVClient) Query(ctx context.Context, query *api.Query) (*api.VulnerabilityList, error)
- func (c *OSVClient) QueryBatch(ctx context.Context, queries []*api.Query) (*api.BatchVulnerabilityList, error)
Constants ¶
const ( QueryBatchEndpoint = "/v1/querybatch" QueryEndpoint = "/v1/query" GetEndpoint = "/v1/vulns" // DetermineVersionEndpoint is the URL for posting determineversion queries to OSV. DetermineVersionEndpoint = "/v1experimental/determineversion" // MaxQueriesPerQueryBatchRequest is a limit set in osv.dev's API, so is not configurable MaxQueriesPerQueryBatchRequest = 1000 DefaultBaseURL = "https://api.osv.dev" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type OSVClient ¶
type OSVClient struct {
HTTPClient *http.Client
Config ClientConfig
BaseHostURL string
}
func DefaultClient ¶
func DefaultClient() *OSVClient
DefaultClient creates a new OSVClient with default settings
func (*OSVClient) ExperimentalDetermineVersion ¶
func (c *OSVClient) ExperimentalDetermineVersion(ctx context.Context, query *api.DetermineVersionParameters) (*api.VersionMatchList, error)
func (*OSVClient) GetVulnByID ¶
GetVulnByID is an interface to this endpoint: https://google.github.io/osv.dev/get-v1-vulns/
func (*OSVClient) Query ¶
Query is an interface to this endpoint: https://google.github.io/osv.dev/post-v1-query/ This function performs paging invisibly until the context expires, after which all pages that has already been retrieved are returned.
See if next_page_token field in the response is fully filled out to determine if there are extra pages remaining
func (*OSVClient) QueryBatch ¶
func (c *OSVClient) QueryBatch(ctx context.Context, queries []*api.Query) (*api.BatchVulnerabilityList, error)
QueryBatch is an interface to this endpoint: https://google.github.io/osv.dev/post-v1-querybatch/ This function performs paging invisibly until the context expires, after which all pages that has already been retrieved are returned.
See if next_page_token field in the response is fully filled out to determine if there are extra pages remaining