versioner

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoVersions   = errors.New("no available versions")
	ErrNoExecutable = errors.New("no executable found")
	ErrNoRemoveBase = errors.New("can't remove base version")
)

Functions

func VerifyUpdateFolder added in v3.2.0

func VerifyUpdateFolder(kr *crypto.KeyRing, path string) error

Types

type Version

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

func (*Version) Equal

func (v *Version) Equal(version *semver.Version) bool

func (*Version) GetExecutable

func (v *Version) GetExecutable(name string) (string, error)

GetExecutable returns the full path to the executable of the given version. It returns an error if the executable is missing or does not have executable permissions set.

func (*Version) Remove

func (v *Version) Remove() error

Remove removes this version directory.

func (*Version) SemVer

func (v *Version) SemVer() *semver.Version

func (*Version) String

func (v *Version) String() string

func (*Version) VerifyFiles

func (v *Version) VerifyFiles(kr *crypto.KeyRing) error

VerifyFiles verifies all files in the version directory.

type Versioner

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

Versioner manages a directory of versioned app directories.

func New

func New(root string) *Versioner

func (*Versioner) GetExecutableInDirectory

func (v *Versioner) GetExecutableInDirectory(name, directory string) (string, error)

GetExecutableInDirectory returns the full path to the executable in the given directory, if present. It returns an error if the executable is missing or does not have executable permissions set.

func (*Versioner) InstallNewVersion

func (v *Versioner) InstallNewVersion(version *semver.Version, r io.Reader) error

InstallNewVersion installs a tgz update package of the given version.

func (*Versioner) ListVersions

func (v *Versioner) ListVersions() (Versions, error)

ListVersions returns a collection of all available version numbers, sorted from newest to oldest.

func (*Versioner) RemoveCurrentVersion

func (v *Versioner) RemoveCurrentVersion() error

func (*Versioner) RemoveOldVersions

func (v *Versioner) RemoveOldVersions() error

RemoveOldVersions removes all but the latest app version.

func (*Versioner) RemoveOtherVersions

func (v *Versioner) RemoveOtherVersions(versionToKeep *semver.Version) error

RemoveOtherVersions removes all but the specific provided app version.

type Versions

type Versions []*Version

func (Versions) HasVersion

func (v Versions) HasVersion(want *semver.Version) bool

func (Versions) Len

func (v Versions) Len() int

func (Versions) Less

func (v Versions) Less(i, j int) bool

func (Versions) Swap

func (v Versions) Swap(i, j int)

Jump to

Keyboard shortcuts

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