repo

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 6 Imported by: 0

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

func (w *Watcher) DeriveRepoFullName(partial string) (repo string)

DeriveRepoFullName derives the full name of a repo from a partial name.

func (*Watcher) IsRepoValid

func (w *Watcher) IsRepoValid(repo string) (bool, error)

IsRepoValid returns true if repo is found in the list of Go repos, and false otherwise.

func (*Watcher) ListGoRepos

func (w *Watcher) ListGoRepos() ([]string, error)

ListGoRepos returns the last seen list of Go repos.

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the repo watch cycle.

type WatcherConfig

type WatcherConfig struct {
	Logger logrus.FieldLogger
}

A WatcherConfig configures a Watcher.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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