upstream

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package upstream implements logic for retrieving latest released software versions based on this software upstream source URL.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestError    = errors.New("request error")
	ErrProviderError   = errors.New("version provider error")
	ErrVersionNotFound = errors.New("upstream version not found")
)

Functions

This section is empty.

Types

type Version

type Version string

Version represents the software version as returned by some VersionProvider.

func ParseVersion added in v0.3.0

func ParseVersion(rawVersion string) (Version, bool)

ParseVersion makes Version from a string. If the string cannot be interpreted as a Version, returns nil.

func (Version) GetVersionStr

func (v Version) GetVersionStr() string

type VersionProvider

type VersionProvider interface {
	LatestVersion() (Version, error)
	Equal(other interface{}) bool
}

VersionProvider tries to find the latest software version based on its source URL.

func NewVersionProvider

func NewVersionProvider(url string, providersConfig config.Value) VersionProvider

NewVersionProvider tries to create a VersionProvider instance for a given URL. Returns nil if there's no suitable provider.

Jump to

Keyboard shortcuts

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