github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/format/syftjson/model/file.go (about)

     1  package model
     2  
     3  import (
     4  	"github.com/anchore/syft/syft/file"
     5  	"github.com/anchore/syft/syft/license"
     6  )
     7  
     8  type File struct {
     9  	ID       string             `json:"id"`
    10  	Location file.Coordinates   `json:"location"`
    11  	Metadata *FileMetadataEntry `json:"metadata,omitempty"`
    12  	Contents string             `json:"contents,omitempty"`
    13  	Digests  []file.Digest      `json:"digests,omitempty"`
    14  	Licenses []FileLicense      `json:"licenses,omitempty"`
    15  }
    16  
    17  type FileMetadataEntry struct {
    18  	Mode            int    `json:"mode"`
    19  	Type            string `json:"type"`
    20  	LinkDestination string `json:"linkDestination,omitempty"`
    21  	UserID          int    `json:"userID"`
    22  	GroupID         int    `json:"groupID"`
    23  	MIMEType        string `json:"mimeType"`
    24  	Size            int64  `json:"size"`
    25  }
    26  
    27  type FileLicense struct {
    28  	Value          string               `json:"value"`
    29  	SPDXExpression string               `json:"spdxExpression"`
    30  	Type           license.Type         `json:"type"`
    31  	Evidence       *FileLicenseEvidence `json:"evidence,omitempty"`
    32  }
    33  
    34  type FileLicenseEvidence struct {
    35  	Confidence int `json:"confidence"`
    36  	Offset     int `json:"offset"`
    37  	Extent     int `json:"extent"`
    38  }