Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListerService ¶
type ListerService interface { ListGoRepos() ([]string, error) DeriveRepoFullName(partial string) (repo string) }
A ListerService lists the Go repositories from VCS platforms like GitHub.
type ValidatorService ¶
type ValidatorService interface { IsRepoValid(repo string) (bool, error) DeriveRepoFullName(partial string) (repo string) }
A ValidatorService can validate repos (in terms of whether or they not they are an existing repo that contains Go).
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
A Watcher caches and updates a list of repos at regular intervals. It is safe for concurrent use.
func NewWatcher ¶
func NewWatcher( lister ListerService, interval time.Duration, opts ...func(*WatcherConfig), ) *Watcher
NewWatcher creates a new Watcher, which keeps an updated list of Go repositories, and checks for updates at regular intervals.
func (*Watcher) DeriveRepoFullName ¶
DeriveRepoFullName derives the full name of a repo from a partial name.
func (*Watcher) IsRepoValid ¶
IsRepoValid returns true if repo is found in the list of Go repos, and false otherwise.
func (*Watcher) ListGoRepos ¶
ListGoRepos returns the last seen list of Go repos.
type WatcherConfig ¶
type WatcherConfig struct {
Logger logrus.FieldLogger
}
A WatcherConfig configures a Watcher.