search

package
v3.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: BSD-2-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TntIoURI = "https://www.tarantool.io/en/accounts/customer_zone"
	APIURI   = TntIoURI + "/api"
	PkgURI   = TntIoURI + "/packages"
)

Variables

This section is empty.

Functions

func GetAPIPackage

func GetAPIPackage(program binary.Program) string

GetAPIPackage returns the package name at tarantool.io for the given program.

func GetCommitFromGitLocal

func GetCommitFromGitLocal(repo, ref string) (string, error)

GetCommitFromGitLocal reads the revision reported by git show without fetching. For an annotated tag object, git show reports the tag name before the commit.

func GetCommitFromGitRemote

func GetCommitFromGitRemote(repo, ref string) (string, error)

GetCommitFromGitRemote clones the remote repository and resolves a commit, tag or branch.

func GetPullRequestCommitFromGitLocal

func GetPullRequestCommitFromGitLocal(repo, pullRequestID string) (string, error)

GetPullRequestCommitFromGitLocal fetches the pull request and resolves its head commit.

func GetPullRequestCommitFromGitRemote

func GetPullRequestCommitFromGitRemote(repo, pullRequestID string) (string, error)

GetPullRequestCommitFromGitRemote clones the repository and fetches the pull request's head.

func GetVersionsFromGitLocal

func GetVersionsFromGitLocal(repo string, program binary.Program) (version.VersionSlice, error)

GetVersionsFromGitLocal returns sorted versions list from specified local git repo.

func GetVersionsFromGitRemote

func GetVersionsFromGitRemote(repo string) (version.VersionSlice, error)

GetVersionsFromGitRemote returns sorted versions list from specified remote git repo.

func Less

func Less(verLeft, verRight version.Version) bool

Less is a common function-comparator using for the Version type.

func NewPlatformInformer

func NewPlatformInformer() *realInfo

func NewTntIoDoer

func NewTntIoDoer() *httpDoer

func SearchVersions

func SearchVersions(searchCtx SearchCtx) error

SearchVersions outputs available versions of program.

func SearchVersionsLocal

func SearchVersionsLocal(searchCtx SearchCtx) error

SearchVersionsLocal outputs available versions of program found locally.

func TntIoMakePkgURI

func TntIoMakePkgURI(searchCtx *SearchCtx, tarball string) (string, error)

TntIoMakePkgURI generates a URI for downloading a package.

Types

type BundleInfo

type BundleInfo struct {
	// Version represents the info about the bundle's version.
	Version version.Version
	// Package represents package name.
	Package string
	// Release represents the release version (e.g: 2.10).
	Release string
	// Download token.
	Token string
}

BundleInfo contains the version and download information of an archive.

func SelectVersion

func SelectVersion(bundles BundleInfoSlice, ver string) (BundleInfo, error)

SelectVersion selects a specific version from the list of available bundles. If no version is specified, it returns the latest version.

type BundleInfoSlice

type BundleInfoSlice []BundleInfo

BundleInfoSlice attaches the methods of sort.Interface to []Version, sorting from oldest to newest.

func FetchBundlesInfo

func FetchBundlesInfo(searchCtx *SearchCtx) (
	BundleInfoSlice, error,
)

FetchBundlesInfo returns available product archives in ascending version order.

func FindLocalBundles

func FindLocalBundles(program binary.Program, fsys fs.FS) (BundleInfoSlice, error)

FindLocalBundles finds and parses local product archives.

func (BundleInfoSlice) Len

func (bundles BundleInfoSlice) Len() int

Len implements sort.Interface.

func (BundleInfoSlice) Less

func (bundles BundleInfoSlice) Less(i, j int) bool

Less implements sort.Interface.

func (BundleInfoSlice) Swap

func (bundles BundleInfoSlice) Swap(i, j int)

Swap implements sort.Interface.

type PlatformInformer

type PlatformInformer interface {
	// GetOs returns the operating system type.
	GetOs() (binary.OsType, error)
	// GetArch returns the architecture type.
	GetArch() (string, error)
}

PlatformInformer is an interface that provides methods to get platform information.

type SearchCtx

type SearchCtx struct {
	binary.BinaryContext

	// LocalRepo is the source directory: --local-repo for Git repositories,
	// or --local-dir for SDK or standalone archives.
	LocalRepo string
	// CredentialsFile contains customer-zone credentials for remote EE and TCM searches.
	CredentialsFile string
	// Debug includes debug builds instead of release builds.
	Debug bool
	// Filter out which builds of tarantool-ee must be included in the result of search.
	Filter SearchFlags
	// What package to look for.
	// FIXME: It looks like this is not needed here, as it is then auto filled via [GetApiPackage].
	Package string
	// Release version to look for.
	ReleaseVersion string
	// Search for development builds.
	DevBuilds bool
	// TntIoDoer tarantool.io API handler with interface of TntIoDoer.
	TntIoDoer binary.TntIoDoer
	// contains filtered or unexported fields
}

SearchCtx contains information for programs searching.

func NewSearchCtx

func NewSearchCtx(informer PlatformInformer, doer binary.TntIoDoer) SearchCtx

NewSearchCtx creates a new SearchCtx with default production values.

type SearchFlags

type SearchFlags int64
const (
	SearchRelease SearchFlags = iota
	SearchDebug
	SearchAll
)

Jump to

Keyboard shortcuts

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