Documentation
¶
Index ¶
- Constants
- Variables
- func QuickSort(iList []Item, ascend bool) (r []string)
- func SortStringList(sl []string) []string
- func SortVersion(vs []string) []string
- func ToAnyArch(archType, osType string) string
- func ToAnyOs(archType, osType string) string
- func ToDarwinX64(archType, osType string) string
- func ToUniverseForMac(archType, osType string) string
- func ToUnixArch(archType, osType string) string
- func ToUnixOs(archType, osType string) string
- func ToWindowsOnly(archType, osType string) string
- type Item
- type StringComparator
- type VersionComparator
- type VersionInfo
- func (v *VersionInfo) GetSortedVersionList() (r []string)
- func (v *VersionInfo) GetVersions() map[string]VersionList
- func (v *VersionInfo) Parse()
- func (v *VersionInfo) RegisterArchHandler(f func(archType, osType string) string)
- func (v *VersionInfo) RegisterOsHandler(f func(archType, osType string) string)
- type VersionItem
- type VersionList
Constants ¶
View Source
const (
RemoteVersionFilePattern string = "https://raw.githubusercontent.com/gvcgo/resources/main/%s.version.json"
)
Variables ¶
View Source
var ArchHandlerList = map[string]func(archType, osType string) string{ "gradle": ToAnyArch, "gsudo": ToAnyArch, "maven": ToAnyArch, "neovim": ToUniverseForMac, "python": ToAnyArch, "rust": ToAnyArch, "sdkmanager": ToAnyArch, "vscode": ToDarwinX64, }
View Source
var OsHandlerList = map[string]func(archType, osType string) string{ "gradle": ToAnyOs, "gsudo": ToWindowsOnly, "maven": ToAnyOs, "python": ToAnyOs, "rust": ToUnixOs, }
Functions ¶
func SortStringList ¶
func ToDarwinX64 ¶
func ToUniverseForMac ¶
func ToUnixArch ¶
func ToWindowsOnly ¶
Types ¶
type StringComparator ¶
type StringComparator struct {
Origin string
}
func (*StringComparator) Greater ¶
func (sc *StringComparator) Greater(item Item) bool
func (*StringComparator) String ¶
func (sc *StringComparator) String() string
type VersionComparator ¶
Version Comparator
func (*VersionComparator) Greater ¶
func (ver *VersionComparator) Greater(item Item) bool
func (*VersionComparator) String ¶
func (ver *VersionComparator) String() string
type VersionInfo ¶
type VersionInfo struct {
List map[string]VersionList // full version list
CurrentList map[string]VersionList // version list for current Arch and Os.
AppName string // name in AppList
ArchHandler func(archType, osType string) string
OsHandler func(archType, osType string) string
// contains filtered or unexported fields
}
func NewVInfo ¶
func NewVInfo(appName string) (vi *VersionInfo)
func (*VersionInfo) GetSortedVersionList ¶
func (v *VersionInfo) GetSortedVersionList() (r []string)
func (*VersionInfo) GetVersions ¶
func (v *VersionInfo) GetVersions() map[string]VersionList
func (*VersionInfo) Parse ¶
func (v *VersionInfo) Parse()
func (*VersionInfo) RegisterArchHandler ¶
func (v *VersionInfo) RegisterArchHandler(f func(archType, osType string) string)
func (*VersionInfo) RegisterOsHandler ¶
func (v *VersionInfo) RegisterOsHandler(f func(archType, osType string) string)
type VersionItem ¶
type VersionList ¶
type VersionList []VersionItem
Click to show internal directories.
Click to hide internal directories.