version

package
v0.4.8-alpha17 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LegacyCasaOSServiceName = "casaos.service"
)

Variables

View Source
var (
	GlobalMigrationStatusDirPath = "/var/lib/casaos/migration"

	ErrInvalidServiceName = errors.New("service name should not contain space or upper case letter")
)
View Source
var (
	ErrLegacyVersionNotFound = errors.New("legacy version not found")
	ErrVersionNotFound       = errors.New("version (non-legacy) not found")
)
View Source
var (
	// this value will be updated at init() to actual config file path.
	LegacyCasaOSConfigFilePath = "/etc/casaos.conf"
)

Functions

func Compare

func Compare(v1, v2 string) (int, error)

func DetectLegacyVersion

func DetectLegacyVersion() (int, int, int, error)

func DetectMinorVersion

func DetectMinorVersion() (int, error)

Detect minor version of CasaOS. It returns 2 for "0.2.x" or 3 for "0.3.x"

(This is often useful when failing to get version from API because CasaOS is not running.)

func DetectVersion

func DetectVersion() (int, int, int, error)

func IsConfigKeyDBPathExist

func IsConfigKeyDBPathExist() (bool, error)

Check if user data is stored in database (0.3.3+)

func ParseVersion

func ParseVersion(version string) (int, int, int, int, string, error)

retuns major, minor, patch, build and annotation.

e.g. "1.2.3.4-alpha1" returns 1, 2, 3, 4, "alpha1"

Types

type GlobalMigrationStatus

type GlobalMigrationStatus struct {
	ServiceName         string
	LastMigratedVersion string
}

func GetGlobalMigrationStatus

func GetGlobalMigrationStatus(serviceName string) (*GlobalMigrationStatus, error)

func (*GlobalMigrationStatus) Done

func (m *GlobalMigrationStatus) Done(version string) error

func (*GlobalMigrationStatus) GetGlobalMigrationStatusFilePath

func (m *GlobalMigrationStatus) GetGlobalMigrationStatusFilePath() string

Jump to

Keyboard shortcuts

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