upgrade

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 20 Imported by: 7

Documentation

Index

Constants

View Source
const BuildKey = `` /* 3172-byte string literal not displayed */

WL build key: 693C86E9DECA9D07D79FF9D22ECD72AD056012E1

View Source
const SKIP_FILENAME = ".skip-upgrade-version"
View Source
const Supported = false

Variables

This section is empty.

Functions

func Confirm

func Confirm(prompt string) bool

func ExecutorSimple

func ExecutorSimple(ea ExecutorArgs) (err error)

func ExecutorSupervised

func ExecutorSupervised(ea ExecutorArgs) (err error)

Types

type Config

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

func NewConfig

func NewConfig(fm fsdir.T, arg0 string, interactive bool) *Config

func (*Config) BinaryURL

func (u *Config) BinaryURL(ver semver.Version) string

func (*Config) ChangelogURL

func (u *Config) ChangelogURL(ver semver.Version) string

func (*Config) Cleanup

func (u *Config) Cleanup()

func (*Config) Download

func (u *Config) Download(out, url, distuser, distpass string) error

func (*Config) GetBinary

func (u *Config) GetBinary(ver semver.Version, binpath string, s512 []byte) (err error)

func (*Config) GetChangelog

func (u *Config) GetChangelog(ver semver.Version) (_ string, err error)

func (*Config) GetHash

func (u *Config) GetHash(ver semver.Version) (sha512 []byte, err error)

func (*Config) HashURL

func (u *Config) HashURL(ver semver.Version) string

func (*Config) SkipVersion

func (u *Config) SkipVersion(v semver.Version) error

func (*Config) SkippedVersion

func (u *Config) SkippedVersion() (v *semver.Version)

func (*Config) Upgrade

func (u *Config) Upgrade(ex Executor, v0, v1 semver.Version) (err error)

full upgrade procedure

type Executor

type Executor func(ExecutorArgs) error

type ExecutorArgs

type ExecutorArgs struct {
	// Root directory of upgrade executor.
	Root fsdir.T
	// Source and destination binary paths relative to Root.
	SrcBin, DstBin string
	// Source and destination versions.
	SrcVer, DstVer semver.Version
}

ExecutorArgs are the working parameters of the upgrade executor.

type Migration

type Migration struct {
	Name     string
	Version  semver.Version
	Apply    func(fsdir.T) error
	Rollback func(fsdir.T) error
}

func (*Migration) TryApply

func (m *Migration) TryApply(f fsdir.T) error

type WriteCounter

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

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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