updater

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ILocalScripts

type ILocalScripts interface {
	// LocalCurrentVersion Get the current version locally
	LocalCurrentVersion() (*semver.Version, error)
}

type IRemoteScripts

type IRemoteScripts interface {
	// RemoteLatestVersion Get the latest version from the remote server.
	RemoteLatestVersion() (*semver.Version, error)

	// RemoteGetUpgradeScripts Fetch the upgrade script from the remote server.
	RemoteGetUpgradeScripts(*semver.Version) (IUpgradeScripts, error)

	// RemoteVersions Retrieve all versions that meet the criteria from the remote server.
	RemoteVersions(constraints ...*semver.Constraints) ([]*semver.Version, error)
}

type IUpgradeScripts

type IUpgradeScripts interface {
	UpgradeInfo() (IUpgradeScriptsInfo, error)

	UpgradeExec(from *semver.Version) error
}

type IUpgradeScriptsInfo

type IUpgradeScriptsInfo interface {

	// UpgradeInfoCurrent
	UpgradeInfoCurrent() (*semver.Version, error)

	// UpgradeInfoConstraint
	UpgradeInfoConstraint() (*semver.Constraints, error)
}

type Updater

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

func NewUpdater

func NewUpdater(local ILocalScripts, remote IRemoteScripts) *Updater

func (*Updater) Exec

func (p *Updater) Exec(upgrades []*UpgradeArgs) error

func (*Updater) GenerateUpgrades

func (p *Updater) GenerateUpgrades() (upgrades []*UpgradeArgs, err error)

type UpgradeArgs

type UpgradeArgs struct {
	From   *semver.Version
	Script IUpgradeScripts
}

Jump to

Keyboard shortcuts

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