resultstore

package
v0.0.0-...-c4af43d Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFilename

func DefaultFilename(p Pkg) string

DefaultFilename returns the basename (i.e. without directory-like prefixes) of the default filename (key) used to store results. If p is non-nil and has a version specified, the default filename is <version>.json. Otherwise, it is "results.json".

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func ConstructPath

func ConstructPath() Option

ConstructPath will cause Save() to append a suffix to the base path based on Pkg.EcosystemName() and Pkg.Name().

type Pkg

type Pkg interface {
	Ecosystem() pkgecosystem.Ecosystem
	EcosystemName() string
	Name() string
	Version() string
}

Pkg describes the various package details used to populate the package part of the analysis results.

type ResultStore

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

func New

func New(bucket string, options ...Option) *ResultStore

New creates a new ResultStore instance with the given bucket URL and options. If the bucket URL is invalid, a nil pointer is returned.

func (*ResultStore) SaveAnalyzedPackage

func (rs *ResultStore) SaveAnalyzedPackage(ctx context.Context, manager *pkgmanager.PkgManager, pkg Pkg) error

func (*ResultStore) SaveDynamicAnalysis

func (rs *ResultStore) SaveDynamicAnalysis(ctx context.Context, p Pkg, analysis any, filename string) error

SaveDynamicAnalysis wraps the analysis object with the DynamicAnalysisRecord struct and saves it to the bucket using saveWithFilename. If filename is empty, a default filename (chosen using DefaultFilename) is used.

func (*ResultStore) SaveStaticAnalysis

func (rs *ResultStore) SaveStaticAnalysis(ctx context.Context, p Pkg, data *staticanalysis.Record, filename string) error

SaveStaticAnalysis wraps the results object with the Record struct and saves it to the bucket using saveWithFilename. If filename is empty, a default filename (chosen using DefaultFilename) is used.

func (*ResultStore) SaveTempFilesToZip

func (rs *ResultStore) SaveTempFilesToZip(ctx context.Context, p Pkg, zipName string, tempFileNames []string) error

func (*ResultStore) String

func (rs *ResultStore) String() string

Jump to

Keyboard shortcuts

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