poweruser

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONDocument

type JSONDocument struct {
	// note: poweruser.JSONDocument is meant to always be a superset of packages.JSONDocument, any additional fields
	// here should be optional by supplying "omitempty" on these fields hint to the jsonschema generator to not
	// require these fields. As an accepted rule in this repo all collections should still be initialized in the
	// context of being used in a JSON document.
	FileClassifications []JSONFileClassifications `json:"fileClassifications,omitempty"` // note: must have omitempty
	FileContents        []JSONFileContents        `json:"fileContents,omitempty"`        // note: must have omitempty
	FileMetadata        []JSONFileMetadata        `json:"fileMetadata,omitempty"`        // note: must have omitempty
	Secrets             []JSONSecrets             `json:"secrets,omitempty"`             // note: must have omitempty
	packages.JSONDocument
}

func NewJSONDocument

func NewJSONDocument(config JSONDocumentConfig) (JSONDocument, error)

NewJSONDocument creates and populates a new JSON document struct from the given cataloging results.

type JSONDocumentConfig

type JSONDocumentConfig struct {
	ApplicationConfig   config.Application
	PackageCatalog      *pkg.Catalog
	FileMetadata        map[source.Location]source.FileMetadata
	FileDigests         map[source.Location][]file.Digest
	FileClassifications map[source.Location][]file.Classification
	FileContents        map[source.Location]string
	Secrets             map[source.Location][]file.SearchResult
	Distro              *distro.Distro
	SourceMetadata      source.Metadata
}

type JSONFileClassifications

type JSONFileClassifications struct {
	Location       source.Location     `json:"location"`
	Classification file.Classification `json:"classification"`
}

func NewJSONFileClassifications

func NewJSONFileClassifications(data map[source.Location][]file.Classification) []JSONFileClassifications

type JSONFileContents

type JSONFileContents struct {
	Location source.Location `json:"location"`
	Contents string          `json:"contents"`
}

func NewJSONFileContents

func NewJSONFileContents(data map[source.Location]string) []JSONFileContents

type JSONFileMetadata

type JSONFileMetadata struct {
	Location source.Location       `json:"location"`
	Metadata JSONFileMetadataEntry `json:"metadata"`
}

func NewJSONFileMetadata

func NewJSONFileMetadata(data map[source.Location]source.FileMetadata, digests map[source.Location][]file.Digest) ([]JSONFileMetadata, error)

type JSONFileMetadataEntry

type JSONFileMetadataEntry struct {
	Mode            int             `json:"mode"`
	Type            source.FileType `json:"type"`
	LinkDestination string          `json:"linkDestination,omitempty"`
	UserID          int             `json:"userID"`
	GroupID         int             `json:"groupID"`
	Digests         []file.Digest   `json:"digests,omitempty"`
}

type JSONPresenter

type JSONPresenter struct {
	// contains filtered or unexported fields
}

JSONPresenter is a JSON presentation object for the syft results

func NewJSONPresenter

func NewJSONPresenter(config JSONDocumentConfig) *JSONPresenter

NewJSONPresenter creates a new JSON presenter object for the given cataloging results.

func (*JSONPresenter) Present

func (p *JSONPresenter) Present(output io.Writer) error

Present the PackageCatalog results to the given writer.

type JSONSecrets

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

func NewJSONSecrets

func NewJSONSecrets(data map[source.Location][]file.SearchResult) []JSONSecrets

Jump to

Keyboard shortcuts

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