component_vul_dao

package
v0.0.0-...-8ef6624 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentVulDao

type ComponentVulDao interface {

	// Create 保存组件漏洞信息
	Create(ctx context.Context, cv *models.ComponentVul) error

	// Update 更新组件漏洞
	Update(ctx context.Context, cv *models.ComponentVul) error

	// Upsert 组件漏洞存在的话则更新,否则插入
	Upsert(ctx context.Context, cv *models.ComponentVul) error

	// FindByComponentName 根据组件名称查询上面的所有漏洞
	FindByComponentName(ctx context.Context, componentName string) ([]*models.ComponentVul, error)

	// Find 根据组件名字和版本查询漏洞
	Find(ctx context.Context, componentName, componentVersion string) ([]*models.ComponentVul, error)

	// DeleteByVulId 根据漏洞ID删除组件漏洞
	DeleteByVulId(ctx context.Context, vulId string) (int64, error)

	// DeleteByComponentName 根据组件的名字删除组件漏洞
	DeleteByComponentName(ctx context.Context, componentName string) (int64, error)

	// DeleteByComponentNameAndVersion 根据组件的名字和版本删除组件漏洞
	// return:
	// int64: 被删除的数据条数
	// error: if has error
	DeleteByComponentNameAndVersion(ctx context.Context, componentName, componentVersion string) (int64, error)

	// LoadAll 加载所有的组件漏洞
	LoadAll(ctx context.Context) ([]*models.ComponentVul, error)
}

ComponentVulDao 组件漏洞dao

type ComponentVulMemoryDao

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

func NewComponentVulMemoryDaoFromJsonLine

func NewComponentVulMemoryDaoFromJsonLine(ctx context.Context, jsonLineBytes []byte) (*ComponentVulMemoryDao, error)

NewComponentVulMemoryDaoFromJsonLine 从jsonline文件中创建

func (*ComponentVulMemoryDao) Create

func (*ComponentVulMemoryDao) DeleteByComponentName

func (x *ComponentVulMemoryDao) DeleteByComponentName(ctx context.Context, componentName string) (int64, error)

func (*ComponentVulMemoryDao) DeleteByComponentNameAndVersion

func (x *ComponentVulMemoryDao) DeleteByComponentNameAndVersion(ctx context.Context, componentName, componentVersion string) (int64, error)

func (*ComponentVulMemoryDao) DeleteByVulId

func (x *ComponentVulMemoryDao) DeleteByVulId(ctx context.Context, vulId string) (int64, error)

func (*ComponentVulMemoryDao) Find

func (x *ComponentVulMemoryDao) Find(ctx context.Context, componentName, componentVersion string) ([]*models.ComponentVul, error)

func (*ComponentVulMemoryDao) FindByComponentName

func (x *ComponentVulMemoryDao) FindByComponentName(ctx context.Context, componentName string) ([]*models.ComponentVul, error)

func (*ComponentVulMemoryDao) LoadAll

func (*ComponentVulMemoryDao) Update

func (*ComponentVulMemoryDao) Upsert

type ComponentVulMysqlDao

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

ComponentVulMysqlDao mysql实现

func NewComponentVulMysqlDao

func NewComponentVulMysqlDao(gorm *gorm.DB) *ComponentVulMysqlDao

func (*ComponentVulMysqlDao) Create

func (*ComponentVulMysqlDao) DeleteByComponentName

func (x *ComponentVulMysqlDao) DeleteByComponentName(ctx context.Context, componentName string) (int64, error)

func (*ComponentVulMysqlDao) DeleteByComponentNameAndVersion

func (x *ComponentVulMysqlDao) DeleteByComponentNameAndVersion(ctx context.Context, componentName, componentVersion string) (int64, error)

func (*ComponentVulMysqlDao) DeleteByVulId

func (x *ComponentVulMysqlDao) DeleteByVulId(ctx context.Context, vulId string) (int64, error)

func (*ComponentVulMysqlDao) Find

func (x *ComponentVulMysqlDao) Find(ctx context.Context, componentName, componentVersion string) ([]*models.ComponentVul, error)

func (*ComponentVulMysqlDao) FindByComponentName

func (x *ComponentVulMysqlDao) FindByComponentName(ctx context.Context, componentName string) ([]*models.ComponentVul, error)

func (*ComponentVulMysqlDao) LoadAll

func (*ComponentVulMysqlDao) Update

func (*ComponentVulMysqlDao) Upsert

Jump to

Keyboard shortcuts

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