nvd

package
v0.0.0-...-b42f91c Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NVDBaseCVEURL = "https://services.nvd.nist.gov/rest/json/cves/2.0"
	NVDBaseCPEURL = "https://services.nvd.nist.gov/rest/json/cpes/2.0"

	DefaultWaitInterval = time.Second

	DefaultQueryTimeFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the client to query NVD API

func NewClient

func NewClient(opts ...Option) (*Client, error)

func (Client) GetCPEsInRange

func (c Client) GetCPEsInRange(sdate, edate string) (*schema.APIResp[schema.CpeItem], error)

func (Client) GetCVEsInRange

func (c Client) GetCVEsInRange(sdate, edate string) (*schema.APIResp[schema.CveItem], error)

type Option

type Option func(*Client) error

func APIKey

func APIKey(apikey string) Option

func BaseCPEURL

func BaseCPEURL(url string) Option

func BaseCVEURL

func BaseCVEURL(url string) Option

func Logger

func Logger(logger *zap.Logger) Option

func Retries

func Retries(retries int) Option

func Timeout

func Timeout(timeout time.Duration) Option

func Wait

func Wait(wait time.Duration) Option

type Querier

type Querier[T schema.APIRespItem] struct {
	// contains filtered or unexported fields
}

func (Querier[T]) GetDataInLastModRange

func (qr Querier[T]) GetDataInLastModRange(cli *retryablehttp.Client, sdate, edate string) (*schema.APIResp[T], error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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