cnnvd

package
v0.0.0-...-308edb3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Schema = "https"
	Domain = "www.cnnvd.org.cn"
)
View Source
const (
	VulnDetailPath = "web/cnnvdVul/getCnnnvdDetailOnDatasource"
	VulDetailFile  = "vuln_detail"
)
View Source
const (
	FirstPage    = 1
	MaxPageSize  = 50
	VulnListPath = "web/homePage/cnnvdVulList"
	VulListFile  = "vuln_list"
)
View Source
const (
	HazardLevelPath = "web/dictionaries/type/hazardLevel"
)
View Source
const (
	ProductPath = "web/homePage/getProductSelectList"
)
View Source
const (
	VendorPath = "web/homePage/getVendorSelectList"
)
View Source
const (
	VulnTypePath = "web/homePage/vulTypeList"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CNNVD

type CNNVD struct {
	Year  int
	Month int
	ID    int
}

func NewCNNVD

func NewCNNVD(str string) (*CNNVD, error)

func (*CNNVD) After

func (c *CNNVD) After(item *CNNVD) bool

func (*CNNVD) Equal

func (c *CNNVD) Equal(item *CNNVD) bool

func (*CNNVD) FormatCNNVD

func (c *CNNVD) FormatCNNVD() (string, error)

func (*CNNVD) GetDate

func (c *CNNVD) GetDate() *time.Time

type CnnvdClient

type CnnvdClient interface {
	Fetch(retry int) (any, error)
}

type ReqHazardLevel

type ReqHazardLevel struct {
}

ReqHazardLevel 威胁等级请求参数

func (*ReqHazardLevel) Fetch

func (r *ReqHazardLevel) Fetch(retry int) ([]*model.HazardLevel, error)

type ReqProduct

type ReqProduct struct {
	ProductKeyword string `json:"productKeyword"` // 产品关键词
}

ReqProduct 产品选择列表请求参数

func (*ReqProduct) Fetch

func (r *ReqProduct) Fetch(retry int) ([]*model.Product, error)

type ReqVendor

type ReqVendor struct {
	VendorKeyword string `json:"vendorKeyword"` // 供应商关键词
}

ReqVendor 供应商选择列表请求参数

func (*ReqVendor) Fetch

func (r *ReqVendor) Fetch(retry int) ([]*model.Vendor, error)

type ReqVulDetail

type ReqVulDetail struct {
	Id        string `json:"id"`        // 漏洞id
	VulType   string `json:"vulType"`   // 漏洞类型
	CnnvdCode string `json:"cnnvdCode"` // cnnvd编号
}

ReqVulDetail cnnvd漏洞详情请求参数

func (*ReqVulDetail) Fetch

func (r *ReqVulDetail) Fetch(retry int) (*model.VulDetail, error)

type ReqVulList

type ReqVulList struct {
	PageIndex   int    `json:"pageIndex"`   // 分页索引
	PageSize    int    `json:"pageSize"`    // 分页大小
	Keyword     string `json:"keyword"`     // 关键字
	HazardLevel string `json:"hazardLevel"` // 漏洞等级
	VulType     string `json:"vulType"`     // 漏洞类型
	Vendor      string `json:"vendor"`      // 供应商
	Product     string `json:"product"`     // 产品
	DateType    string `json:"dateType"`    // 数据类型
}

ReqVulList cnnvd漏洞列表请求参数

func NewReqVulList

func NewReqVulList(keyword string) *ReqVulList

func (*ReqVulList) Fetch

func (r *ReqVulList) Fetch(retry int) ([]*model.Record, error)

func (*ReqVulList) GetPageInfo

func (r *ReqVulList) GetPageInfo(retry int) (loopNum int, total int, err error)

type ReqVulType

type ReqVulType struct {
}

ReqVulType 漏洞类型列表请求参数

func (*ReqVulType) Fetch

func (r *ReqVulType) Fetch(retry int) ([]*model.VulnType, error)

type ResCode

type ResCode struct {
	Code    int    `json:"code,omitempty"`    // 代码
	Success bool   `json:"success,omitempty"` // 是否成功
	Message string `json:"message,omitempty"` // 消息
	Time    string `json:"time,omitempty"`    // 时间
}

ResCode 响应码

type ResHazardLevel

type ResHazardLevel struct {
	ResCode                      // 响应码
	Data    []*model.HazardLevel `json:"data,omitempty"` // 威胁等级列表
}

ResHazardLevel 威胁等级响应参数

type ResProduct

type ResProduct struct {
	ResCode                  // 响应码
	Data    []*model.Product `json:"data,omitempty"` // 产品列表
}

ResProduct 产品选择列表响应参数

type ResVendor

type ResVendor struct {
	ResCode                 // 响应码
	Data    []*model.Vendor `json:"data,omitempty"` // 供应商选择列表
}

ResVendor 供应商选择列表响应参数

type ResVulDetail

type ResVulDetail struct {
	ResCode                  // 响应码
	Data    *model.VulDetail `json:"data,omitempty"` // 漏洞详情数据
}

ResVulDetail cnnvd漏洞详情响应参数

type ResVulList

type ResVulList struct {
	ResCode          // 响应码
	Data    VulnList `json:"data,omitempty"` // cnnvd漏洞列表
}

ResVulList 供应商选择列表响应参数

type ResVulType

type ResVulType struct {
	ResCode                   // 响应码
	Data    []*model.VulnType `json:"data,omitempty"` // 漏洞类型列表
}

ResVulType 漏洞类型列表响应参数

type VulnList

type VulnList struct {
	Total     int             `json:"total,omitempty"`
	Records   []*model.Record `json:"records,omitempty"`
	PageIndex int             `json:"pageIndex,omitempty"`
	PageSize  int             `json:"pageSize,omitempty"`
}

VulnList cnnvd漏洞列表

Jump to

Keyboard shortcuts

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