db

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX added in v0.2.0

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type MetaGithubRepository added in v0.2.0

type MetaGithubRepository struct {
	ID              uuid.UUID
	ScanID          uuid.UUID
	Owner           string
	RepoName        string
	CommitID        string
	Branch          sql.NullString
	IsDefaultBranch sql.NullBool
	BaseCommitID    sql.NullString
	PullRequestID   sql.NullInt32
	PageSeq         sql.NullInt32
}

type NullTargetClass added in v0.2.0

type NullTargetClass struct {
	TargetClass TargetClass
	Valid       bool // Valid is true if TargetClass is not NULL
}

func (*NullTargetClass) Scan added in v0.2.0

func (ns *NullTargetClass) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTargetClass) Value added in v0.2.0

func (ns NullTargetClass) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Package added in v0.2.0

type Package struct {
	ID         string
	TargetType string
	Name       string
	Version    string
}

type Queries added in v0.2.0

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

func New

func New(db DBTX) *Queries

func (*Queries) GetPackages added in v0.2.0

func (q *Queries) GetPackages(ctx context.Context, dollar_1 []string) ([]Package, error)

func (*Queries) GetVulnerabilities added in v0.2.0

func (q *Queries) GetVulnerabilities(ctx context.Context, dollar_1 []string) ([]Vulnerability, error)

func (*Queries) SaveMetaGithubRepository added in v0.2.0

func (q *Queries) SaveMetaGithubRepository(ctx context.Context, arg SaveMetaGithubRepositoryParams) error

func (*Queries) SavePackage added in v0.2.0

func (q *Queries) SavePackage(ctx context.Context, arg SavePackageParams) error

func (*Queries) SaveResult added in v0.2.0

func (q *Queries) SaveResult(ctx context.Context, arg SaveResultParams) error

func (*Queries) SaveResultPackage added in v0.2.0

func (q *Queries) SaveResultPackage(ctx context.Context, arg SaveResultPackageParams) error

func (*Queries) SaveResultVulnerability added in v0.2.0

func (q *Queries) SaveResultVulnerability(ctx context.Context, arg SaveResultVulnerabilityParams) error

func (*Queries) SaveScan added in v0.2.0

func (q *Queries) SaveScan(ctx context.Context, arg SaveScanParams) error

func (*Queries) SaveVulnerability added in v0.2.0

func (q *Queries) SaveVulnerability(ctx context.Context, arg SaveVulnerabilityParams) error

func (*Queries) UpdateVulnerability added in v0.2.0

func (q *Queries) UpdateVulnerability(ctx context.Context, arg UpdateVulnerabilityParams) error

func (*Queries) WithTx added in v0.2.0

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Result added in v0.2.0

type Result struct {
	ID         uuid.UUID
	ScanID     uuid.UUID
	Target     string
	TargetType string
	Class      TargetClass
}

type ResultPackage added in v0.2.0

type ResultPackage struct {
	ID       uuid.UUID
	ResultID uuid.UUID
	PkgID    string
}

type ResultVulnerability added in v0.2.0

type ResultVulnerability struct {
	ID           uuid.UUID
	ResultID     uuid.UUID
	VulnID       string
	PkgID        string
	FixedVersion sql.NullString
	PrimaryUrl   sql.NullString
}

type SaveMetaGithubRepositoryParams added in v0.2.0

type SaveMetaGithubRepositoryParams struct {
	ID              uuid.UUID
	ScanID          uuid.UUID
	Owner           string
	RepoName        string
	Branch          sql.NullString
	IsDefaultBranch sql.NullBool
	CommitID        string
	BaseCommitID    sql.NullString
	PullRequestID   sql.NullInt32
}

type SavePackageParams added in v0.2.0

type SavePackageParams struct {
	ID         string
	TargetType string
	Name       string
	Version    string
}

type SaveResultPackageParams added in v0.2.0

type SaveResultPackageParams struct {
	ID       uuid.UUID
	ResultID uuid.UUID
	PkgID    string
}

type SaveResultParams added in v0.2.0

type SaveResultParams struct {
	ID         uuid.UUID
	ScanID     uuid.UUID
	Target     string
	TargetType string
	Class      TargetClass
}

type SaveResultVulnerabilityParams added in v0.2.0

type SaveResultVulnerabilityParams struct {
	ID           uuid.UUID
	ResultID     uuid.UUID
	VulnID       string
	PkgID        string
	FixedVersion sql.NullString
	PrimaryUrl   sql.NullString
}

type SaveScanParams added in v0.2.0

type SaveScanParams struct {
	ID           uuid.UUID
	ArtifactName string
	ArtifactType string
}

type SaveVulnerabilityParams added in v0.2.0

type SaveVulnerabilityParams struct {
	ID             string
	Title          string
	Description    string
	Severity       string
	CweIds         []string
	Cvss           pqtype.NullRawMessage
	Reference      []string
	PublishedAt    sql.NullTime
	LastModifiedAt sql.NullTime
}

type Scan added in v0.2.0

type Scan struct {
	ID           uuid.UUID
	CreatedAt    time.Time
	ArtifactName string
	ArtifactType string
	PageSeq      sql.NullInt32
}

type TargetClass added in v0.2.0

type TargetClass string
const (
	TargetClassOsPkgs   TargetClass = "os-pkgs"
	TargetClassLangPkgs TargetClass = "lang-pkgs"
)

func (*TargetClass) Scan added in v0.2.0

func (e *TargetClass) Scan(src interface{}) error

type UpdateVulnerabilityParams added in v0.2.0

type UpdateVulnerabilityParams struct {
	ID             string
	Title          string
	Description    string
	Severity       string
	CweIds         []string
	Cvss           pqtype.NullRawMessage
	Reference      []string
	PublishedAt    sql.NullTime
	LastModifiedAt sql.NullTime
}

type Vulnerability added in v0.2.0

type Vulnerability struct {
	ID             string
	Title          string
	Description    string
	Severity       string
	CweIds         []string
	Cvss           pqtype.NullRawMessage
	Reference      []string
	PublishedAt    sql.NullTime
	LastModifiedAt sql.NullTime
}

Jump to

Keyboard shortcuts

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