download

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMatchingArch added in v0.4.22

func IsMatchingArch(r, arch string) bool

func IsMatchingOS added in v0.4.22

func IsMatchingOS(r, o string) bool

Types

type APIServer added in v0.4.22

type APIServer interface {
	GetHostURL() string
	Download(path string) ([]byte, error)
}

type Download

type Download struct {
	Name              string
	Version           string
	URL               string
	APIServerArtifact string
	Dir               string
	InstallTime       time.Time
	OverrideExe       string `json:"-"`
	IsCached          bool
}

func (*Download) GetExePath added in v0.4.31

func (d *Download) GetExePath(path string) string

func (*Download) Install

func (d *Download) Install(file string) error

type DownloadMeta

type DownloadMeta struct {
	Name            string
	LatestVersion   string
	LatestCheckTime time.Time
	Installed       []*Download
	Dir             string
}

func (*DownloadMeta) FindLatestOrLastInstalledVersion added in v0.4.26

func (meta *DownloadMeta) FindLatestOrLastInstalledVersion() *Download

func (*DownloadMeta) FindVersion

func (meta *DownloadMeta) FindVersion(version string, cacheTime time.Duration, stale bool) *Download

type GithubReleaseMatcher added in v0.4.23

type GithubReleaseMatcher func(string) ReleasePriority

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) GetMeta

func (m *Manager) GetMeta(name string) *DownloadMeta

func (*Manager) Install

func (m *Manager) Install(spec *Spec) (*Download, error)

func (*Manager) List

func (m *Manager) List() (result []*DownloadMeta)

func (*Manager) Reinstall added in v0.4.22

func (m *Manager) Reinstall(spec *Spec) (*Download, error)

func (*Manager) Remove

func (m *Manager) Remove(name, version string) error

type ReleasePriority added in v0.4.23

type ReleasePriority int
const (
	NoMatch ReleasePriority = 0
	Match   ReleasePriority = 100
)

func DefaultReleaseMatcher added in v0.4.22

func DefaultReleaseMatcher(r string) ReleasePriority

func DefaultReleasePriority added in v0.4.23

func DefaultReleasePriority(r string) ReleasePriority

type Spec added in v0.4.22

type Spec struct {
	Name                       string
	RequestedVersion           string
	URL                        string
	APIServerArtifact          string
	APIServer                  APIServer
	GithubReleaseMatcher       GithubReleaseMatcher
	LatestReleaseCacheDuration time.Duration
	GetLatestVersion           func(*Spec) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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