github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/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  	Executable *file.Executable   `json:"executable,omitempty"`
    16  }
    17  
    18  type FileMetadataEntry struct {
    19  	Mode            int    `json:"mode"`
    20  	Type            string `json:"type"`
    21  	LinkDestination string `json:"linkDestination,omitempty"`
    22  	UserID          int    `json:"userID"`
    23  	GroupID         int    `json:"groupID"`
    24  	MIMEType        string `json:"mimeType"`
    25  	Size            int64  `json:"size"`
    26  }
    27  
    28  type FileLicense struct {
    29  	Value          string               `json:"value"`
    30  	SPDXExpression string               `json:"spdxExpression"`
    31  	Type           license.Type         `json:"type"`
    32  	Evidence       *FileLicenseEvidence `json:"evidence,omitempty"`
    33  }
    34  
    35  type FileLicenseEvidence struct {
    36  	Confidence int `json:"confidence"`
    37  	Offset     int `json:"offset"`
    38  	Extent     int `json:"extent"`
    39  }