tracker

package
v0.0.0-...-3dc0db1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

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

Predict returns the predicted category according to the model for the package provided. The prediction is based on the package's keywords.

type PackageCategoryClassifierMock

type PackageCategoryClassifierMock struct {
	mock.Mock
}

PackageCategoryClassifierMock is a mock implementation of the PackageCategoryClassifier interface.

func (*PackageCategoryClassifierMock) Predict

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.

func (*Tracker) Run

func (t *Tracker) Run() error

Run initializes the tracking of the repository provided.

Directories

Path Synopsis
olm

Jump to

Keyboard shortcuts

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