generate

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFinder added in v1.15.0

type ConfigFinder interface {
	Find(wd, configFilePath string, globalConfigFilePaths ...string) (string, error)
}

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 Filter added in v1.31.0

type Filter struct {
	Prefix     string
	Filter     *vm.Program
	Constraint string
}

type FindingPackage

type FindingPackage struct {
	PackageInfo  *registry.PackageInfo
	RegistryName string
	Version      string
}

type FuzzyFinder added in v1.6.1

type FuzzyFinder interface {
	Find(pkgs []*FindingPackage) ([]int, error)
}

func NewFuzzyFinder added in v1.6.1

func NewFuzzyFinder() FuzzyFinder

func NewMockFuzzyFinder added in v1.6.1

func NewMockFuzzyFinder(idxs []int, err error) FuzzyFinder

type Outputter added in v1.22.0

type Outputter interface {
	Output(param *output.Param) error
}

type RepositoriesService added in v1.15.0

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 Version added in v1.15.0

type Version struct {
	Name        string
	Version     string
	Description string
	URL         string
}

type VersionSelector added in v1.15.0

type VersionSelector interface {
	Find(versions []*Version) (int, error)
}

func NewMockVersionSelector added in v1.15.0

func NewMockVersionSelector(idx int, err error) VersionSelector

func NewVersionSelector added in v1.15.0

func NewVersionSelector() VersionSelector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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