github.com/quay/claircore@v1.5.28/libvuln/driver/updatediff.go (about)

     1  package driver
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/google/uuid"
     7  
     8  	"github.com/quay/claircore"
     9  )
    10  
    11  type UpdateKind string
    12  
    13  var VulnerabilityKind UpdateKind = "vulnerability"
    14  var EnrichmentKind UpdateKind = "enrichment"
    15  
    16  // Our diff terminology uses UpdateOpeartion A and UpdateOperation B as arguments.
    17  // A is always the base and B is the update being applied over A.
    18  
    19  // UpdateOperation is a unique update to the vulnstore by an Updater.
    20  type UpdateOperation struct {
    21  	Ref         uuid.UUID   `json:"ref"`
    22  	Updater     string      `json:"updater"`
    23  	Fingerprint Fingerprint `json:"fingerprint"`
    24  	Date        time.Time   `json:"date"`
    25  	Kind        UpdateKind  `json:"kind"`
    26  }
    27  
    28  // UpdateDiff represents added or removed vulnerabilities between update operations
    29  type UpdateDiff struct {
    30  	Prev    UpdateOperation           `json:"prev"`
    31  	Cur     UpdateOperation           `json:"cur"`
    32  	Added   []claircore.Vulnerability `json:"added"`
    33  	Removed []claircore.Vulnerability `json:"removed"`
    34  }