Documentation
¶
Index ¶
- type ComponentVulDao
- type ComponentVulMemoryDao
- func (x *ComponentVulMemoryDao) Create(ctx context.Context, cv *models.ComponentVul) error
- func (x *ComponentVulMemoryDao) DeleteByComponentName(ctx context.Context, componentName string) (int64, error)
- func (x *ComponentVulMemoryDao) DeleteByComponentNameAndVersion(ctx context.Context, componentName, componentVersion string) (int64, error)
- func (x *ComponentVulMemoryDao) DeleteByVulId(ctx context.Context, vulId string) (int64, error)
- func (x *ComponentVulMemoryDao) Find(ctx context.Context, componentName, componentVersion string) ([]*models.ComponentVul, error)
- func (x *ComponentVulMemoryDao) FindByComponentName(ctx context.Context, componentName string) ([]*models.ComponentVul, error)
- func (x *ComponentVulMemoryDao) LoadAll(ctx context.Context) ([]*models.ComponentVul, error)
- func (x *ComponentVulMemoryDao) Update(ctx context.Context, cv *models.ComponentVul) error
- func (x *ComponentVulMemoryDao) Upsert(ctx context.Context, cv *models.ComponentVul) error
- type ComponentVulMysqlDao
- func (x *ComponentVulMysqlDao) Create(ctx context.Context, cv *models.ComponentVul) error
- func (x *ComponentVulMysqlDao) DeleteByComponentName(ctx context.Context, componentName string) (int64, error)
- func (x *ComponentVulMysqlDao) DeleteByComponentNameAndVersion(ctx context.Context, componentName, componentVersion string) (int64, error)
- func (x *ComponentVulMysqlDao) DeleteByVulId(ctx context.Context, vulId string) (int64, error)
- func (x *ComponentVulMysqlDao) Find(ctx context.Context, componentName, componentVersion string) ([]*models.ComponentVul, error)
- func (x *ComponentVulMysqlDao) FindByComponentName(ctx context.Context, componentName string) ([]*models.ComponentVul, error)
- func (x *ComponentVulMysqlDao) LoadAll(ctx context.Context) ([]*models.ComponentVul, error)
- func (x *ComponentVulMysqlDao) Update(ctx context.Context, cv *models.ComponentVul) error
- func (x *ComponentVulMysqlDao) Upsert(ctx context.Context, cv *models.ComponentVul) error
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 (x *ComponentVulMemoryDao) Create(ctx context.Context, cv *models.ComponentVul) error
func (*ComponentVulMemoryDao) DeleteByComponentName ¶
func (*ComponentVulMemoryDao) DeleteByComponentNameAndVersion ¶
func (*ComponentVulMemoryDao) DeleteByVulId ¶
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 (x *ComponentVulMemoryDao) LoadAll(ctx context.Context) ([]*models.ComponentVul, error)
func (*ComponentVulMemoryDao) Update ¶
func (x *ComponentVulMemoryDao) Update(ctx context.Context, cv *models.ComponentVul) error
func (*ComponentVulMemoryDao) Upsert ¶
func (x *ComponentVulMemoryDao) Upsert(ctx context.Context, cv *models.ComponentVul) error
type ComponentVulMysqlDao ¶
type ComponentVulMysqlDao struct {
// contains filtered or unexported fields
}
ComponentVulMysqlDao mysql实现
func NewComponentVulMysqlDao ¶
func NewComponentVulMysqlDao(gorm *gorm.DB) *ComponentVulMysqlDao
func (*ComponentVulMysqlDao) Create ¶
func (x *ComponentVulMysqlDao) Create(ctx context.Context, cv *models.ComponentVul) error
func (*ComponentVulMysqlDao) DeleteByComponentName ¶
func (*ComponentVulMysqlDao) DeleteByComponentNameAndVersion ¶
func (*ComponentVulMysqlDao) DeleteByVulId ¶
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 (x *ComponentVulMysqlDao) LoadAll(ctx context.Context) ([]*models.ComponentVul, error)
func (*ComponentVulMysqlDao) Update ¶
func (x *ComponentVulMysqlDao) Update(ctx context.Context, cv *models.ComponentVul) error
func (*ComponentVulMysqlDao) Upsert ¶
func (x *ComponentVulMysqlDao) Upsert(ctx context.Context, cv *models.ComponentVul) error
Click to show internal directories.
Click to hide internal directories.