versions

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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,
	"groovy":     ToAnyArch,
	"gsudo":      ToAnyArch,
	"maven":      ToAnyArch,
	"neovim":     ToUniverseForMac,
	"python":     ToAnyArch,
	"pypy":       ToAnyArch,
	"rust":       ToAnyArch,
	"sdkmanager": ToAnyArch,
	"vscode":     ToDarwinX64,
	"scala":      ToAnyArch,
	"v":          ToAnyArch,
}
View Source
var OsHandlerList = map[string]func(archType, osType string) string{
	"gradle": ToAnyOs,
	"groovy": ToAnyOs,
	"gsudo":  ToWindowsOnly,
	"maven":  ToAnyOs,
	"python": ToAnyOs,
	"pypy":   ToAnyOs,
	"rust":   ToUnixOs,
	"scala":  ToAnyOs,
}

Functions

func ToAnyArch

func ToAnyArch(archType, osType string) string

Arch handler

func ToAnyOs

func ToAnyOs(archType, osType string) string

Os handler

func ToDarwinX64

func ToDarwinX64(archType, osType string) string

func ToUniverseForMac

func ToUniverseForMac(archType, osType string) string

func ToUnixArch

func ToUnixArch(archType, osType string) string

func ToUnixOs

func ToUnixOs(archType, osType string) string

func ToWindowsOnly

func ToWindowsOnly(archType, osType string) string

Types

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 VersionItem struct {
	Url     string `json:"Url"`
	Arch    string `json:"Arch"`
	Os      string `json:"Os"`
	Sum     string `json:"Sum"`
	SumType string `json:"SumType"`
	Extra   string `json:"Extra"`
}

type VersionList

type VersionList []VersionItem

Jump to

Keyboard shortcuts

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