version

package
v0.4.22 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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