Documentation ¶
Index ¶
- type Option
- type Pkg
- type ResultStore
- func (rs *ResultStore) Save(ctx context.Context, p Pkg, analysis interface{}) error
- func (rs *ResultStore) SaveAnalyzedPackage(ctx context.Context, manager *pkgmanager.PkgManager, pkg Pkg) error
- func (rs *ResultStore) SaveTempFilesToZip(ctx context.Context, p Pkg, zipName string, tempFileNames []string) error
- func (rs *ResultStore) SaveWithFilename(ctx context.Context, p Pkg, filename string, analysis any) error
- func (rs *ResultStore) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ¶
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) Save ¶
func (rs *ResultStore) Save(ctx context.Context, p Pkg, analysis interface{}) error
Save marshals the given analysis results to JSON and writes them to the bucket with a default filename (key). If p is non-nil and has a version specified, the default filename is <version>.json. Otherwise, it is "results.json".
func (*ResultStore) SaveAnalyzedPackage ¶
func (rs *ResultStore) SaveAnalyzedPackage(ctx context.Context, manager *pkgmanager.PkgManager, pkg Pkg) error
func (*ResultStore) SaveTempFilesToZip ¶
func (*ResultStore) SaveWithFilename ¶
func (rs *ResultStore) SaveWithFilename(ctx context.Context, p Pkg, filename string, analysis any) error
SaveWithFilename saves results to the bucket with the given filename
func (*ResultStore) String ¶
func (rs *ResultStore) String() string