Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRepositories ¶
func GetRepositories( cfg *viper.Viper, rm hub.RepositoryManager, kind hub.RepositoryKind, ) ([]*hub.Repository, error)
GetRepositories gets the repositories a tracker will process. If a list of repositories names is found in the configuration provided, those will be the repositories returned provided they are found. If no repositories names are found in the configuration, all the repositories of the kind provided will be returned.
Types ¶
type DBErrorsCollector ¶
type DBErrorsCollector struct {
// contains filtered or unexported fields
}
DBErrorsCollector is in charge of collecting errors that happen while repositories are being processed. Once all the processing is done, the collected errors can be flushed, which will store them in the database.
func NewDBErrorsCollector ¶
func NewDBErrorsCollector( ctx context.Context, repoManager hub.RepositoryManager, repos []*hub.Repository, ) *DBErrorsCollector
NewDBErrorsCollector creates a new DBErrorsCollector instance.
func (*DBErrorsCollector) Append ¶
func (c *DBErrorsCollector) Append(repositoryID string, err error)
Append adds the error provided to the repository's list of errors.
func (*DBErrorsCollector) Flush ¶
func (c *DBErrorsCollector) Flush()
Flush aggregates all errors collected per repository as a single text and stores it in the database.
type ErrorsCollector ¶
ErrorsCollector interface defines the methods that an errors collector implementation should provide.
type ErrorsCollectorMock ¶
ErrorsCollectorMock is mock ErrorsCollector implementation.
func (*ErrorsCollectorMock) Append ¶
func (m *ErrorsCollectorMock) Append(repositoryID string, err error)
Append implements the ErrorsCollector interface.
func (*ErrorsCollectorMock) Flush ¶
func (m *ErrorsCollectorMock) Flush()
Flush implements the ErrorsCollector interface.