model

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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 Distro

type Distro struct {
	Name    string `json:"name"`    // Name of the Linux distribution
	Version string `json:"version"` // Version of the Linux distribution (major or major.minor version)
	IDLike  string `json:"idLike"`  // the ID_LIKE field found within the /etc/os-release file
}

Distro provides information about a detected Linux Distro.

type Document

type Document struct {
	Artifacts             []Package            `json:"artifacts"` // Artifacts is the list of packages discovered and placed into the catalog
	ArtifactRelationships []model.Relationship `json:"artifactRelationships"`
	Files                 []model.File         `json:"files,omitempty"`   // note: must have omitempty
	Secrets               []model.Secrets      `json:"secrets,omitempty"` // note: must have omitempty
	Source                Source               `json:"source"`            // Source represents the original object that was cataloged
	Distro                Distro               `json:"distro"`            // Distro represents the Linux distribution that was detected from the source
	Descriptor            model.Descriptor     `json:"descriptor"`        // Descriptor is a block containing self-describing information about syft
	Schema                model.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 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. nolint:funlen

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 []source.Coordinates `json:"locations"`
	Licenses  []string             `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 pkg.MetadataType `json:"metadataType"`
	Metadata     interface{}      `json:"metadata"`
}

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

type Schema

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

type Source

type Source struct {
	Type   string      `json:"type"`
	Target interface{} `json:"target"`
}

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