versioner

package
v1.8.12 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: GPL-3.0 Imports: 16 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")
)

Functions

This section is empty.

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 added in v1.8.10

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) 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) 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