Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFinder ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(configFinder ConfigFinder, configReader reader.ConfigReader, registInstaller rgst.Installer, gh RepositoriesService, fs afero.Fs, fuzzyFinder FuzzyFinder, versionSelector VersionSelector) *Controller
func (*Controller) Generate ¶
func (ctrl *Controller) Generate(ctx context.Context, logE *logrus.Entry, param *config.Param, args ...string) error
Generate searches packages in registries and outputs the configuration to standard output. If no package is specified, the interactive fuzzy finder is launched. If the package supports, the latest version is gotten by GitHub API.
type FindingPackage ¶
type FindingPackage struct { PackageInfo *registry.PackageInfo RegistryName string Version string }
type FuzzyFinder ¶
type FuzzyFinder interface {
Find(pkgs []*FindingPackage) ([]int, error)
}
func NewFuzzyFinder ¶
func NewFuzzyFinder() FuzzyFinder
func NewMockFuzzyFinder ¶
func NewMockFuzzyFinder(idxs []int, err error) FuzzyFinder
type RepositoriesService ¶
type RepositoriesService interface { GetLatestRelease(ctx context.Context, repoOwner, repoName string) (*github.RepositoryRelease, *github.Response, error) ListReleases(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error) ListTags(ctx context.Context, owner string, repo string, opts *github.ListOptions) ([]*github.RepositoryTag, *github.Response, error) }
type VersionSelector ¶
func NewMockVersionSelector ¶
func NewMockVersionSelector(idx int, err error) VersionSelector
func NewVersionSelector ¶
func NewVersionSelector() VersionSelector
Source Files ¶
Click to show internal directories.
Click to hide internal directories.