versiongetter

package
v2.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 10 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 (c *CargoVersionGetter) Get(ctx context.Context, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*CargoVersionGetter) List

func (c *CargoVersionGetter) List(ctx context.Context, pkg *registry.PackageInfo, filters []*Filter) ([]*fuzzyfinder.Item, error)

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, _ *logrus.Entry, pkg *registry.PackageInfo, currentVersion string, useFinder bool) string

type GeneralVersionGetter

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

func (*GeneralVersionGetter) Get

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

func (*GeneralVersionGetter) List

func (g *GeneralVersionGetter) List(ctx context.Context, pkg *registry.PackageInfo, filters []*Filter) ([]*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 (*GitHubReleaseVersionGetter) List

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, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*GitHubTagVersionGetter) List

func (g *GitHubTagVersionGetter) List(ctx context.Context, pkg *registry.PackageInfo, filters []*Filter) ([]*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) 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, pkg *registry.PackageInfo, filters []*Filter) (string, error)

func (*MockVersionGetter) List

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

type VersionGetter

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

Jump to

Keyboard shortcuts

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