model

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Descriptor

type Descriptor struct {
	Name          string      `json:"name"`
	Version       string      `json:"version"`
	Configuration interface{} `json:"configuration,omitempty"`
}

Descriptor describes what created the document as well as surrounding metadata

type Document

type Document struct {
	Artifacts             []Package      `json:"artifacts"` // Artifacts is the list of packages discovered and placed into the catalog
	ArtifactRelationships []Relationship `json:"artifactRelationships"`
	Files                 []File         `json:"files,omitempty"`   // note: must have omitempty
	Secrets               []Secrets      `json:"secrets,omitempty"` // note: must have omitempty
	Source                Source         `json:"source"`            // Source represents the original object that was cataloged
	Distro                LinuxRelease   `json:"distro"`            // Distro represents the Linux distribution that was detected from the source
	Descriptor            Descriptor     `json:"descriptor"`        // Descriptor is a block containing self-describing information about syft
	Schema                Schema         `json:"schema"`            // Schema is a block reserved for defining the version for the shape of this JSON document and where to find the schema document to validate the shape
}

Document represents the syft cataloging findings as a JSON document

type File

type File struct {
	ID       string             `json:"id"`
	Location file.Coordinates   `json:"location"`
	Metadata *FileMetadataEntry `json:"metadata,omitempty"`
	Contents string             `json:"contents,omitempty"`
	Digests  []file.Digest      `json:"digests,omitempty"`
	Licenses []FileLicense      `json:"licenses,omitempty"`
}

type FileLicense

type FileLicense struct {
	Value          string               `json:"value"`
	SPDXExpression string               `json:"spdxExpression"`
	Type           license.Type         `json:"type"`
	Evidence       *FileLicenseEvidence `json:"evidence,omitempty"`
}

type FileLicenseEvidence

type FileLicenseEvidence struct {
	Confidence int `json:"confidence"`
	Offset     int `json:"offset"`
	Extent     int `json:"extent"`
}

type FileMetadataEntry

type FileMetadataEntry struct {
	Mode            int    `json:"mode"`
	Type            string `json:"type"`
	LinkDestination string `json:"linkDestination,omitempty"`
	UserID          int    `json:"userID"`
	GroupID         int    `json:"groupID"`
	MIMEType        string `json:"mimeType"`
	Size            int64  `json:"size"`
}

type IDLikes

type IDLikes []string

func (*IDLikes) UnmarshalJSON

func (s *IDLikes) UnmarshalJSON(data []byte) error

type License

type License struct {
	Value          string          `json:"value"`
	SPDXExpression string          `json:"spdxExpression"`
	Type           license.Type    `json:"type"`
	URLs           []string        `json:"urls"`
	Locations      []file.Location `json:"locations"`
}

type LinuxRelease

type LinuxRelease struct {
	PrettyName       string  `json:"prettyName,omitempty"`
	Name             string  `json:"name,omitempty"`
	ID               string  `json:"id,omitempty"`
	IDLike           IDLikes `json:"idLike,omitempty"`
	Version          string  `json:"version,omitempty"`
	VersionID        string  `json:"versionID,omitempty"`
	VersionCodename  string  `json:"versionCodename,omitempty"`
	BuildID          string  `json:"buildID,omitempty"`
	ImageID          string  `json:"imageID,omitempty"`
	ImageVersion     string  `json:"imageVersion,omitempty"`
	Variant          string  `json:"variant,omitempty"`
	VariantID        string  `json:"variantID,omitempty"`
	HomeURL          string  `json:"homeURL,omitempty"`
	SupportURL       string  `json:"supportURL,omitempty"`
	BugReportURL     string  `json:"bugReportURL,omitempty"`
	PrivacyPolicyURL string  `json:"privacyPolicyURL,omitempty"`
	CPEName          string  `json:"cpeName,omitempty"`
	SupportEnd       string  `json:"supportEnd,omitempty"`
}

type Package

type Package struct {
	PackageBasicData
	PackageCustomData
}

Package represents a pkg.Package object specialized for JSON marshaling and unmarshalling.

func (*Package) UnmarshalJSON

func (p *Package) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller for handling basic values and values with ambiguous types.

type PackageBasicData

type PackageBasicData struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	Version   string          `json:"version"`
	Type      pkg.Type        `json:"type"`
	FoundBy   string          `json:"foundBy"`
	Locations []file.Location `json:"locations"`
	Licenses  licenses        `json:"licenses"`
	Language  pkg.Language    `json:"language"`
	CPEs      []string        `json:"cpes"`
	PURL      string          `json:"purl"`
}

PackageBasicData contains non-ambiguous values (type-wise) from pkg.Package.

type PackageCustomData

type PackageCustomData struct {
	MetadataType string `json:"metadataType,omitempty"`
	Metadata     any    `json:"metadata,omitempty"`
}

PackageCustomData contains ambiguous values (type-wise) from pkg.Package.

type Relationship

type Relationship struct {
	Parent   string      `json:"parent"`
	Child    string      `json:"child"`
	Type     string      `json:"type"`
	Metadata interface{} `json:"metadata,omitempty"`
}

type Schema

type Schema struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

type Secrets

type Secrets struct {
	Location file.Coordinates    `json:"location"`
	Secrets  []file.SearchResult `json:"secrets"`
}

type Source

type Source struct {
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	Version  string      `json:"version"`
	Type     string      `json:"type"`
	Metadata interface{} `json:"metadata"`
}

Source object represents the thing that was cataloged

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(b []byte) error

UnmarshalJSON populates a source object from JSON bytes.

Jump to

Keyboard shortcuts

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