Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRepositories ¶
func GetRepositories( ctx context.Context, cfg *viper.Viper, rm hub.RepositoryManager, ) ([]*hub.Repository, error)
GetRepositories gets the repositories the tracker will process based on the configuration provided:
- If a list of repositories names, those will be the repositories returned provided they are found.
- If a list of repositories kinds is provided, all repositories of those kinds will be returned.
- Otherwise, all the repositories will be returned.
NOTE: disabled repositories will be filtered out.
func SetupSource ¶
func SetupSource(i *hub.TrackerSourceInput) hub.TrackerSource
SetupSource returns the tracker source that should be used for the repository provided.
Types ¶
type PackageCategoryClassifierML ¶
type PackageCategoryClassifierML struct {
// contains filtered or unexported fields
}
PackageCategoryClassifierML classifies packages by category using a ML model.
func NewPackageCategoryClassifierML ¶
func NewPackageCategoryClassifierML(modelPath string) *PackageCategoryClassifierML
NewPackageCategoryClassifierML creates a new CategoryClassifier instance.
func (*PackageCategoryClassifierML) Predict ¶
func (c *PackageCategoryClassifierML) Predict(p *hub.Package) hub.PackageCategory
Predict returns the predicted category according to the model for the package provided. The prediction is based on the package's keywords.
type PackageCategoryClassifierMock ¶
PackageCategoryClassifierMock is a mock implementation of the PackageCategoryClassifier interface.
func (*PackageCategoryClassifierMock) Predict ¶
func (m *PackageCategoryClassifierMock) Predict(p *hub.Package) hub.PackageCategory
Predict implements the PackageCategoryClassifier interface.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is in charge of tracking the packages available in the repository provided, registering and unregistering them as needed.
func New ¶
func New(svc *hub.TrackerServices, r *hub.Repository, logger zerolog.Logger) *Tracker
New creates a new Tracker instance.