db

package
v0.0.0-...-0a3c54e Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BULK_INSERT_SIZE = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	DB *gorm.DB
}

func NewClient

func NewClient(conf *Config) (*Client, error)

func (*Client) BulkUpsertCVE

func (c *Client) BulkUpsertCVE(ctx context.Context, cves []*model.CVE) error

func (*Client) BulkUpsertEPSS

func (c *Client) BulkUpsertEPSS(ctx context.Context, records []*model.EPSS) error

func (*Client) BulkUpsertKEV

func (c *Client) BulkUpsertKEV(ctx context.Context, records []*model.KEV) error

func (*Client) BulkUpsertPoc

func (c *Client) BulkUpsertPoc(ctx context.Context, pocs []*model.PoC) error

func (*Client) CountCVE

func (c *Client) CountCVE(ctx context.Context, where string, args []any) (int64, error)

func (*Client) DeleteEPSS

func (c *Client) DeleteEPSS(ctx context.Context, updatedTime time.Time) error

func (*Client) SelectCVEByFilter

func (c *Client) SelectCVEByFilter(ctx context.Context, where string, args []any, limit int, offset int, order string) ([]*model.CVE, error)

func (*Client) SelectCveByID

func (c *Client) SelectCveByID(ctx context.Context, cveID *string) (*model.CVE, error)

func (*Client) SelectEPSSByCVEID

func (c *Client) SelectEPSSByCVEID(ctx context.Context, cveID *string) (*model.EPSS, error)

func (*Client) SelectKEVByCVEID

func (c *Client) SelectKEVByCVEID(ctx context.Context, cveID *string) (*model.KEV, error)

func (*Client) SelectPoCByCVEID

func (c *Client) SelectPoCByCVEID(ctx context.Context, cveID *string) ([]*model.PoC, error)

func (*Client) SelectPoCByID

func (c *Client) SelectPoCByID(ctx context.Context, cveID *string, repositoryID *uint64) (*model.PoC, error)

type Config

type Config struct {
	Host          string
	User          string
	Password      string
	Schema        string
	Port          int
	LogMode       bool
	MaxConnection int
}

Jump to

Keyboard shortcuts

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