versiongetter

package
v2.23.2-1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CargoClient

type CargoClient interface {
	ListVersions(ctx context.Context, crate string) ([]string, error)
	GetLatestVersion(ctx context.Context, crate string) (string, error)
}

type CargoVersionGetter

type CargoVersionGetter struct {
	// contains filtered or unexported fields
}

func NewCargo

func NewCargo(client CargoClient) *CargoVersionGetter

func (*CargoVersionGetter) Get

func (*CargoVersionGetter) List

type Filter

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

type FuzzyFinder

type FuzzyFinder interface {
	Find(items []*fuzzyfinder.Item, hasPreview bool) (int, error)
	FindMulti(items []*fuzzyfinder.Item, hasPreview bool) ([]int, error)
}

type FuzzyGetter

type FuzzyGetter struct {
	// contains filtered or unexported fields
}

func NewFuzzy

func NewFuzzy(finder FuzzyFinder, getter VersionGetter) *FuzzyGetter

func (*FuzzyGetter) Get

func (g *FuzzyGetter) Get(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, currentVersion string, useFinder bool, limit int) string

type GeneralVersionGetter

type GeneralVersionGetter struct {
	// contains filtered or unexported fields
}

func (*GeneralVersionGetter) Get

func (g *GeneralVersionGetter) Get(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*GeneralVersionGetter) List

func (g *GeneralVersionGetter) List(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter, limit int) ([]*fuzzyfinder.Item, error)

type GitHubReleaseClient

type GitHubReleaseClient 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)
}

type GitHubReleaseVersionGetter

type GitHubReleaseVersionGetter struct {
	// contains filtered or unexported fields
}

func (*GitHubReleaseVersionGetter) Get

func (g *GitHubReleaseVersionGetter) Get(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*GitHubReleaseVersionGetter) List

func (g *GitHubReleaseVersionGetter) List(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter, limit int) ([]*fuzzyfinder.Item, error)

type GitHubTagClient

type GitHubTagClient interface {
	ListTags(ctx context.Context, owner string, repo string, opts *github.ListOptions) ([]*github.RepositoryTag, *github.Response, error)
}

type GitHubTagVersionGetter

type GitHubTagVersionGetter struct {
	// contains filtered or unexported fields
}

func (*GitHubTagVersionGetter) Get

func (g *GitHubTagVersionGetter) Get(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*GitHubTagVersionGetter) List

func (g *GitHubTagVersionGetter) List(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter, limit int) ([]*fuzzyfinder.Item, error)

type MockCargoClient

type MockCargoClient struct {
	// contains filtered or unexported fields
}

func NewMockCargoClient

func NewMockCargoClient(versions map[string][]string) *MockCargoClient

func (*MockCargoClient) GetLatestVersion

func (g *MockCargoClient) GetLatestVersion(ctx context.Context, crate string) (string, error)

func (*MockCargoClient) ListVersions

func (g *MockCargoClient) ListVersions(ctx context.Context, crate string) ([]string, error)

type MockFuzzyGetter

type MockFuzzyGetter struct {
	// contains filtered or unexported fields
}

func NewMockFuzzyGetter

func NewMockFuzzyGetter(versions map[string]string) *MockFuzzyGetter

func (*MockFuzzyGetter) Get

func (g *MockFuzzyGetter) Get(ctx context.Context, _ *logrus.Entry, pkg *registry.PackageInfo, currentVersion string, useFinder bool, limit int) string

type MockGitHubReleaseClient

type MockGitHubReleaseClient struct {
	// contains filtered or unexported fields
}

func NewMockGitHubReleaseClient

func NewMockGitHubReleaseClient(releases map[string][]*github.RepositoryRelease) *MockGitHubReleaseClient

func (*MockGitHubReleaseClient) GetLatestRelease

func (g *MockGitHubReleaseClient) GetLatestRelease(ctx context.Context, repoOwner, repoName string) (*github.RepositoryRelease, *github.Response, error)

func (*MockGitHubReleaseClient) ListReleases

func (g *MockGitHubReleaseClient) ListReleases(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error)

type MockGitHubTagClient

type MockGitHubTagClient struct {
	// contains filtered or unexported fields
}

func NewMockGitHubTagClient

func NewMockGitHubTagClient(tags map[string][]*github.RepositoryTag) *MockGitHubTagClient

func (*MockGitHubTagClient) ListTags

type MockVersionGetter

type MockVersionGetter struct {
	// contains filtered or unexported fields
}

func NewMockVersionGetter

func NewMockVersionGetter(versions map[string][]*fuzzyfinder.Item) *MockVersionGetter

func (*MockVersionGetter) Get

func (g *MockVersionGetter) Get(ctx context.Context, _ *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*MockVersionGetter) List

func (g *MockVersionGetter) List(ctx context.Context, _ *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter, limit int) ([]*fuzzyfinder.Item, error)

type VersionGetter

type VersionGetter interface {
	Get(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter) (string, error)
	List(ctx context.Context, logE *logrus.Entry, pkg *registry.PackageInfo, filters []*Filter, limit int) ([]*fuzzyfinder.Item, error)
}

Jump to

Keyboard shortcuts

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