Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewDefaultDriver ¶
func NewDefaultDriver(insightsClient insightsv2grpc.InsightServiceClient, malysisClient malysisv1grpc.MalwareAnalysisServiceClient, gh *adapters.GithubClient, ) (*defaultDriver, error)
NewDefaultDriver creates a new default driver with the given clients Always follow dependency inversion principle when extending the driver
Types ¶
type Driver ¶
type Driver interface {
// Return all available versions for a package
GetPackageAvailableVersions(ctx context.Context, p *packagev1.Package) ([]*packagev1.PackageVersion, error)
// Return the latest version for a package
GetPackageLatestVersion(ctx context.Context, p *packagev1.Package) (*packagev1.PackageVersion, error)
// Return a malware analysis report for a package version
GetPackageVersionMalwareReport(ctx context.Context, pv *packagev1.PackageVersion) (*malysisv1pb.Report, error)
// Return vulnerabilities for a package version
GetPackageVersionVulnerabilities(ctx context.Context, pv *packagev1.PackageVersion) ([]*vulnerabilityv1.Vulnerability, error)
// Return popularity insights for a package version
GetPackageVersionPopularity(ctx context.Context, pv *packagev1.PackageVersion) ([]*packagev1.ProjectInsight, error)
// Return license information for a package version
GetPackageVersionLicenseInfo(ctx context.Context, pv *packagev1.PackageVersion) (*packagev1.LicenseMetaList, error)
}
Driver is the contract for all the services available in this system. Tools use driver to actually perform operations. The purpose of using a Driver instead of using services directly in tools is to allow for caching and other stateful operations while keeping tools stateless
type DriverConfig ¶
type DriverConfig struct{}
func DefaultDriverConfig ¶
func DefaultDriverConfig() DriverConfig
Click to show internal directories.
Click to hide internal directories.