Documentation ¶
Index ¶
- func DefaultFilename(p Pkg) string
- type Option
- type Pkg
- type ResultStore
- func (rs *ResultStore) SaveAnalyzedPackage(ctx context.Context, manager *pkgmanager.PkgManager, pkg Pkg) error
- func (rs *ResultStore) SaveDynamicAnalysis(ctx context.Context, p Pkg, analysis any, filename string) error
- func (rs *ResultStore) SaveStaticAnalysis(ctx context.Context, p Pkg, data *staticanalysis.Record, filename string) error
- func (rs *ResultStore) SaveTempFilesToZip(ctx context.Context, p Pkg, zipName string, tempFileNames []string) error
- func (rs *ResultStore) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultFilename ¶
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 (*ResultStore) String ¶
func (rs *ResultStore) String() string