github.com/quay/claircore@v1.5.28/datastore/postgres/scan_vulnerability.go (about)

     1  package postgres
     2  
     3  import (
     4  	"strconv"
     5  
     6  	"github.com/quay/claircore"
     7  )
     8  
     9  type scanner interface {
    10  	Scan(dest ...interface{}) error
    11  }
    12  
    13  func scanVulnerability(v *claircore.Vulnerability, row scanner) error {
    14  	var id uint64
    15  	if err := row.Scan(
    16  		&id,
    17  		&v.Name,
    18  		&v.Updater,
    19  		&v.Description,
    20  		&v.Issued,
    21  		&v.Links,
    22  		&v.Severity,
    23  		&v.NormalizedSeverity,
    24  		&v.Package.Name,
    25  		&v.Package.Version,
    26  		&v.Package.Module,
    27  		&v.Package.Arch,
    28  		&v.Package.Kind,
    29  		&v.Dist.DID,
    30  		&v.Dist.Name,
    31  		&v.Dist.Version,
    32  		&v.Dist.VersionCodeName,
    33  		&v.Dist.VersionID,
    34  		&v.Dist.Arch,
    35  		&v.Dist.CPE,
    36  		&v.Dist.PrettyName,
    37  		&v.ArchOperation,
    38  		&v.Repo.Name,
    39  		&v.Repo.Key,
    40  		&v.Repo.URI,
    41  		&v.FixedInVersion,
    42  	); err != nil {
    43  		return err
    44  	}
    45  	v.ID = strconv.FormatUint(id, 10)
    46  	return nil
    47  }