Documentation ¶
Index ¶
- Constants
- Variables
- func CurrentModuleVersion(module string, sysrootPath string) (*semver.Version, error)
- func CurrentReleaseVersion(sysrootPath string) (*semver.Version, error)
- func DownloadAllMigrationTools(ctx context.Context, release codegen.Release, sysrootPath string) (bool, error)
- func DownloadChecksum(ctx context.Context, release codegen.Release, mirror string) (string, error)
- func DownloadMigrationTool(ctx context.Context, release codegen.Release, moduleName string, ...) (string, error)
- func DownloadRelease(ctx context.Context, release codegen.Release, force bool) (string, error)
- func DownloadUninstallScript(ctx context.Context, sysRoot string) (string, error)
- func ExecuteMigrationTool(moduleName string, migrationFilePath string, sysRoot string) error
- func ExecuteModuleInstallScript(releaseFilePath string, release codegen.Release) error
- func ExtractOfflineRAUCToTemp(sysRoot string) error
- func ExtractRAUCRelease(packageFilepath string, release codegen.Release) error
- func GetChecksums(release codegen.Release) (map[string]string, error)
- func GetFileNameFromMigrationURL(url string) string
- func GetMigrationDownloadURLFromMigrationListURL(url string) string
- func GetRelease(ctx context.Context, tag string) (*codegen.Release, error)
- func GetReleaseBranch(sysRoot string) string
- func GetStatus() (codegen.Status, string)
- func InitEventTypeMapStatus()
- func InstallDependencies(release codegen.Release, sysrootPath string) error
- func InstallRAUC(release codegen.Release, sysRoot string, ...) error
- func InstallRAUCHandlerV1(RAUCFilePath string) error
- func InstallRAUCTest(raucfilepath string) error
- func InstallRelease(release codegen.Release, sysrootPath string) error
- func IsCasaOS(sysRoot string) bool
- func IsUpgradable(release codegen.Release, sysrootPath string) bool
- func IsZimaOS(sysRoot string) bool
- func LaunchModule(release codegen.Release) error
- func MigrationToolsDir() string
- func MigrationToolsMap(release codegen.Release) (map[string][]MigrationTool, error)
- func NormalizationVersion(version string) string
- func NormalizeMigrationToolURL(url string) string
- func NormalizeMigrationToolURLPass1(url string) string
- func NormalizeMigrationToolURLPass2(url string) string
- func NormalizeVersion(version string) string
- func PostInstallRAUC(release codegen.Release, sysRoot string) error
- func PostMigration(sysRoot string) error
- func PostReleaseInstall(release codegen.Release, sysrootPath string) error
- func PublishEventWrapper(ctx context.Context, eventType message_bus.EventType, ...)
- func RebootSystem()
- func ReleaseDir(release codegen.Release) (string, error)
- func ShouldUpgrade(release codegen.Release, sysrootPath string) bool
- func StartFallbackWebsite()
- func StartMigration(sysRoot string) error
- func StopFallbackWebsite()
- func StopModule(release codegen.Release) error
- func UpdateStatusWithMessage(eventType EventType, newPackageStatus string)
- func VerifyAllMigrationTools(targetRelease codegen.Release, sysRoot string) bool
- func VerifyChecksumByFilePath(filepath, checksum string) error
- func VerifyMigrationTool(moduleName string, fileName string) (string, error)
- func VerifyRAUC(release codegen.Release) (string, error)
- func VerifyRAUCOfflineRelease(release codegen.Release) (string, error)
- func VerifyRAUCRelease(release codegen.Release) (string, error)
- func VerifyRelease(release codegen.Release) (string, error)
- func VerifyUninstallScript(sysRoot string) bool
- type EventType
- type InstallerServiceInterface
- type InstallerType
- type MigrationTool
- type RAUCOfflineService
- func (r *RAUCOfflineService) DownloadAllMigrationTools(ctx context.Context, release codegen.Release) error
- func (r *RAUCOfflineService) DownloadRelease(ctx context.Context, release codegen.Release, force bool) (string, error)
- func (r *RAUCOfflineService) ExtractRelease(packageFilepath string, release codegen.Release) error
- func (r *RAUCOfflineService) GetMigrationInfo(ctx context.Context, release codegen.Release) error
- func (r *RAUCOfflineService) GetRelease(ctx context.Context, tag string) (*codegen.Release, error)
- func (r *RAUCOfflineService) Install(release codegen.Release, sysRoot string) error
- func (r *RAUCOfflineService) IsUpgradable(release codegen.Release, sysrootPath string) bool
- func (r *RAUCOfflineService) LoadReleaseFromOfflineRAUC(sysRoot string) (*codegen.Release, error)
- func (r *RAUCOfflineService) MigrationInLaunch(sysRoot string) error
- func (r *RAUCOfflineService) PostInstall(release codegen.Release, sysRoot string) error
- func (r *RAUCOfflineService) PostMigration(sysRoot string) error
- func (r *RAUCOfflineService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
- func (r *RAUCOfflineService) VerifyRelease(release codegen.Release) (string, error)
- type RAUCService
- func (r *RAUCService) DownloadAllMigrationTools(ctx context.Context, release codegen.Release) error
- func (r *RAUCService) DownloadRelease(ctx context.Context, release codegen.Release, force bool) (string, error)
- func (r *RAUCService) ExtractRelease(packageFilepath string, release codegen.Release) error
- func (r *RAUCService) GetMigrationInfo(ctx context.Context, release codegen.Release) error
- func (r *RAUCService) GetRelease(ctx context.Context, tag string) (*codegen.Release, error)
- func (r *RAUCService) Install(release codegen.Release, sysRoot string) error
- func (r *RAUCService) IsUpgradable(release codegen.Release, sysrootPath string) bool
- func (r *RAUCService) MigrationInLaunch(sysRoot string) error
- func (r *RAUCService) PostInstall(release codegen.Release, sysRoot string) error
- func (r *RAUCService) PostMigration(sysRoot string) error
- func (r *RAUCService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
- func (r *RAUCService) VerifyRelease(release codegen.Release) (string, error)
- type Services
- type StatusService
- func (r *StatusService) Cronjob(sysRoot string) error
- func (r *StatusService) DownloadAllMigrationTools(ctx context.Context, release codegen.Release) error
- func (r *StatusService) DownloadRelease(ctx context.Context, release codegen.Release, force bool) (string, error)
- func (r *StatusService) ExtractRelease(packageFilepath string, release codegen.Release) error
- func (r *StatusService) GetMigrationInfo(ctx context.Context, release codegen.Release) error
- func (r *StatusService) GetRelease(ctx context.Context, tag string) (*codegen.Release, error)
- func (r *StatusService) Install(release codegen.Release, sysRoot string) error
- func (r *StatusService) IsUpgradable(release codegen.Release, sysRootPath string) bool
- func (r *StatusService) MigrationInLaunch(sysRoot string) error
- func (r *StatusService) PostInstall(release codegen.Release, sysRoot string) error
- func (r *StatusService) PostMigration(sysRoot string) error
- func (r *StatusService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
- func (r *StatusService) VerifyRelease(release codegen.Release) (string, error)
- type TarService
- type TestService
- func (r *TestService) DownloadAllMigrationTools(ctx context.Context, release codegen.Release) error
- func (r *TestService) DownloadRelease(ctx context.Context, release codegen.Release, force bool) (string, error)
- func (r *TestService) ExtractRelease(packageFilepath string, release codegen.Release) error
- func (r *TestService) GetMigrationInfo(ctx context.Context, release codegen.Release) error
- func (r *TestService) GetRelease(ctx context.Context, tag string) (*codegen.Release, error)
- func (r *TestService) Install(release codegen.Release, sysRoot string) error
- func (r *TestService) IsUpgradable(release codegen.Release, sysRootPath string) bool
- func (r *TestService) MigrationInLaunch(sysRoot string) error
- func (r *TestService) PostInstall(release codegen.Release, sysRoot string) error
- func (r *TestService) PostMigration(sysRoot string) error
- func (r *TestService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
- func (r *TestService) VerifyRelease(release codegen.Release) (string, error)
- type UpdaterServiceInterface
Constants ¶
View Source
const ( RAUC_OFFLINE_PATH = "/DATA/rauc/" RAUC_OFFLINE_RELEASE_FILENAME = "release.yaml" RAUC_OFFLINE_RAUC_FILENAME = "rauc.tar" OFFLINE_RAUC_TEMP_PATH = "/tmp/offline_rauc" )
View Source
const (
FlagUpgradeFile = "/var/lib/casaos/upgradInfo.txt"
)
Variables ¶
View Source
var ( CurrentReleaseLocalPath = "/etc/casaos/release.yaml" TargetReleaseLocalPath = "/etc/casaos/target-release.yaml" )
View Source
var (
ErrReleaseNotFound = fmt.Errorf("release not found")
)
View Source
var EventTypeMapMessageType = make(map[EventType]message_bus.EventType)
View Source
var EventTypeMapStatus = make(map[EventType]codegen.Status)
View Source
var FallbackStaticFiles embed.FS
embeded static files
Functions ¶
func CurrentModuleVersion ¶
func CurrentReleaseVersion ¶
func DownloadChecksum ¶
func DownloadMigrationTool ¶
func DownloadRelease ¶
returns releaseFilePath if successful
func DownloadUninstallScript ¶
func ExecuteMigrationTool ¶
func ExtractOfflineRAUCToTemp ¶ added in v0.2.0
func ExtractRAUCRelease ¶ added in v0.2.0
func GetReleaseBranch ¶ added in v0.2.0
func InitEventTypeMapStatus ¶ added in v0.2.0
func InitEventTypeMapStatus()
func InstallDependencies ¶
func InstallRAUC ¶
func InstallRAUC(release codegen.Release, sysRoot string, InstallRAUCHandler func(raucPath string) error) error
dependent config.ServerInfo.CachePath
func InstallRAUCHandlerV1 ¶ added in v0.2.0
func InstallRAUCTest ¶ added in v0.2.0
func IsUpgradable ¶
to check the new version is upgradable and packages are already cached(download)
func LaunchModule ¶
func MigrationToolsDir ¶
func MigrationToolsDir() string
func MigrationToolsMap ¶
func MigrationToolsMap(release codegen.Release) (map[string][]MigrationTool, error)
func NormalizationVersion ¶ added in v0.2.0
func NormalizeMigrationToolURL ¶
Normalize migraiton tool URL to a standard format which uses `${MIRROR}` as the mirror placeholder
func NormalizeVersion ¶
func PostInstallRAUC ¶ added in v0.2.0
func PostMigration ¶
func PostReleaseInstall ¶
func PublishEventWrapper ¶
func RebootSystem ¶
func RebootSystem()
func StartFallbackWebsite ¶ added in v0.2.0
func StartFallbackWebsite()
func StartMigration ¶
func StopFallbackWebsite ¶ added in v0.2.0
func StopFallbackWebsite()
func StopModule ¶
func UpdateStatusWithMessage ¶ added in v0.2.0
func VerifyAllMigrationTools ¶
verify migration tools for a release are already cached
func VerifyChecksumByFilePath ¶
sha256sum
func VerifyMigrationTool ¶
func VerifyRAUCOfflineRelease ¶ added in v0.2.0
func VerifyRAUCRelease ¶ added in v0.2.0
func VerifyUninstallScript ¶
Types ¶
type EventType ¶ added in v0.2.0
type EventType string
const ( DownloadBegin EventType = "downloadBegin" DownloadEnd EventType = "downloadEnd" DownloadError EventType = "downloadError" FetchUpdateEnd EventType = "fetchUpdateEnd" FetchUpdateBegin EventType = "fetchUpdateBegin" FetchUpdateError EventType = "fetchUpdateError" Idle EventType = "idle" InstallEnd EventType = "installEnd" InstallBegin EventType = "installBegin" InstallError EventType = "installError" )
type InstallerServiceInterface ¶ added in v0.2.0
type InstallerServiceInterface interface { }
type InstallerType ¶ added in v0.2.0
type InstallerType string
const ( RAUC InstallerType = "rauc" RAUCOFFLINE InstallerType = "rauc_offline" TAR InstallerType = "tar" )
func GetInstallMethod ¶
func GetInstallMethod(sysRoot string) (InstallerType, error)
type MigrationTool ¶
type MigrationTool struct { Version semver.Version URL string }
func GetMigrationPath ¶
func GetMigrationPath(module codegen.Module, release codegen.Release, migrationToolMap map[string][]MigrationTool, sysRoot string) ([]MigrationTool, error)
func RemoveDuplication ¶
func RemoveDuplication(arr []MigrationTool) []MigrationTool
type RAUCOfflineService ¶ added in v0.2.0
func (*RAUCOfflineService) DownloadAllMigrationTools ¶ added in v0.2.0
func (*RAUCOfflineService) DownloadRelease ¶ added in v0.2.0
func (*RAUCOfflineService) ExtractRelease ¶ added in v0.2.0
func (r *RAUCOfflineService) ExtractRelease(packageFilepath string, release codegen.Release) error
func (*RAUCOfflineService) GetMigrationInfo ¶ added in v0.2.0
func (*RAUCOfflineService) GetRelease ¶ added in v0.2.0
func (*RAUCOfflineService) Install ¶ added in v0.2.0
func (r *RAUCOfflineService) Install(release codegen.Release, sysRoot string) error
func (*RAUCOfflineService) IsUpgradable ¶ added in v0.2.0
func (r *RAUCOfflineService) IsUpgradable(release codegen.Release, sysrootPath string) bool
func (*RAUCOfflineService) LoadReleaseFromOfflineRAUC ¶ added in v0.2.0
func (r *RAUCOfflineService) LoadReleaseFromOfflineRAUC(sysRoot string) (*codegen.Release, error)
func (*RAUCOfflineService) MigrationInLaunch ¶ added in v0.2.0
func (r *RAUCOfflineService) MigrationInLaunch(sysRoot string) error
func (*RAUCOfflineService) PostInstall ¶ added in v0.2.0
func (r *RAUCOfflineService) PostInstall(release codegen.Release, sysRoot string) error
func (*RAUCOfflineService) PostMigration ¶ added in v0.2.0
func (r *RAUCOfflineService) PostMigration(sysRoot string) error
func (*RAUCOfflineService) ShouldUpgrade ¶ added in v0.2.0
func (r *RAUCOfflineService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
func (*RAUCOfflineService) VerifyRelease ¶ added in v0.2.0
func (r *RAUCOfflineService) VerifyRelease(release codegen.Release) (string, error)
type RAUCService ¶ added in v0.2.0
func (*RAUCService) DownloadAllMigrationTools ¶ added in v0.2.0
func (*RAUCService) DownloadRelease ¶ added in v0.2.0
func (*RAUCService) ExtractRelease ¶ added in v0.2.0
func (r *RAUCService) ExtractRelease(packageFilepath string, release codegen.Release) error
func (*RAUCService) GetMigrationInfo ¶ added in v0.2.0
func (*RAUCService) GetRelease ¶ added in v0.2.0
func (*RAUCService) Install ¶ added in v0.2.0
func (r *RAUCService) Install(release codegen.Release, sysRoot string) error
func (*RAUCService) IsUpgradable ¶ added in v0.2.0
func (r *RAUCService) IsUpgradable(release codegen.Release, sysrootPath string) bool
func (*RAUCService) MigrationInLaunch ¶ added in v0.2.0
func (r *RAUCService) MigrationInLaunch(sysRoot string) error
func (*RAUCService) PostInstall ¶ added in v0.2.0
func (r *RAUCService) PostInstall(release codegen.Release, sysRoot string) error
func (*RAUCService) PostMigration ¶ added in v0.2.0
func (r *RAUCService) PostMigration(sysRoot string) error
func (*RAUCService) ShouldUpgrade ¶ added in v0.2.0
func (r *RAUCService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
func (*RAUCService) VerifyRelease ¶ added in v0.2.0
func (r *RAUCService) VerifyRelease(release codegen.Release) (string, error)
type Services ¶
type Services interface { Gateway() (external.ManagementService, error) MessageBus() (*message_bus.ClientWithResponses, error) }
var MyService Services
func NewService ¶
type StatusService ¶ added in v0.2.0
type StatusService struct { ImplementService UpdaterServiceInterface SysRoot string }
func (*StatusService) Cronjob ¶ added in v0.2.0
func (r *StatusService) Cronjob(sysRoot string) error
func (*StatusService) DownloadAllMigrationTools ¶ added in v0.2.0
func (*StatusService) DownloadRelease ¶ added in v0.2.0
func (*StatusService) ExtractRelease ¶ added in v0.2.0
func (r *StatusService) ExtractRelease(packageFilepath string, release codegen.Release) error
func (*StatusService) GetMigrationInfo ¶ added in v0.2.0
func (*StatusService) GetRelease ¶ added in v0.2.0
func (*StatusService) Install ¶ added in v0.2.0
func (r *StatusService) Install(release codegen.Release, sysRoot string) error
func (*StatusService) IsUpgradable ¶ added in v0.2.0
func (r *StatusService) IsUpgradable(release codegen.Release, sysRootPath string) bool
func (*StatusService) MigrationInLaunch ¶ added in v0.2.0
func (r *StatusService) MigrationInLaunch(sysRoot string) error
func (*StatusService) PostInstall ¶ added in v0.2.0
func (r *StatusService) PostInstall(release codegen.Release, sysRoot string) error
func (*StatusService) PostMigration ¶ added in v0.2.0
func (r *StatusService) PostMigration(sysRoot string) error
func (*StatusService) ShouldUpgrade ¶ added in v0.2.0
func (r *StatusService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
func (*StatusService) VerifyRelease ¶ added in v0.2.0
func (r *StatusService) VerifyRelease(release codegen.Release) (string, error)
type TarService ¶ added in v0.2.0
type TarService struct { }
func (*TarService) GetRelease ¶ added in v0.2.0
type TestService ¶ added in v0.2.0
type TestService struct { InstallRAUCHandler func(raucPath string) error // contains filtered or unexported fields }
func (*TestService) DownloadAllMigrationTools ¶ added in v0.2.0
func (*TestService) DownloadRelease ¶ added in v0.2.0
func (*TestService) ExtractRelease ¶ added in v0.2.0
func (r *TestService) ExtractRelease(packageFilepath string, release codegen.Release) error
func (*TestService) GetMigrationInfo ¶ added in v0.2.0
func (*TestService) GetRelease ¶ added in v0.2.0
func (*TestService) Install ¶ added in v0.2.0
func (r *TestService) Install(release codegen.Release, sysRoot string) error
func (*TestService) IsUpgradable ¶ added in v0.2.0
func (r *TestService) IsUpgradable(release codegen.Release, sysRootPath string) bool
func (*TestService) MigrationInLaunch ¶ added in v0.2.0
func (r *TestService) MigrationInLaunch(sysRoot string) error
func (*TestService) PostInstall ¶ added in v0.2.0
func (r *TestService) PostInstall(release codegen.Release, sysRoot string) error
func (*TestService) PostMigration ¶ added in v0.2.0
func (r *TestService) PostMigration(sysRoot string) error
func (*TestService) ShouldUpgrade ¶ added in v0.2.0
func (r *TestService) ShouldUpgrade(release codegen.Release, sysRoot string) bool
func (*TestService) VerifyRelease ¶ added in v0.2.0
func (r *TestService) VerifyRelease(release codegen.Release) (string, error)
type UpdaterServiceInterface ¶ added in v0.2.0
type UpdaterServiceInterface interface { GetRelease(ctx context.Context, tag string) (*codegen.Release, error) VerifyRelease(release codegen.Release) (string, error) DownloadRelease(ctx context.Context, release codegen.Release, force bool) (string, error) ExtractRelease(packageFilepath string, release codegen.Release) error GetMigrationInfo(ctx context.Context, release codegen.Release) error DownloadAllMigrationTools(ctx context.Context, release codegen.Release) error Install(release codegen.Release, sysRoot string) error PostInstall(release codegen.Release, sysRoot string) error MigrationInLaunch(sysRoot string) error PostMigration(sysRoot string) error ShouldUpgrade(release codegen.Release, sysRoot string) bool IsUpgradable(release codegen.Release, sysRootPath string) bool // 检测预下载的包好了没有 }
var InstallerService UpdaterServiceInterface
func NewInstallerService ¶ added in v0.2.0
func NewInstallerService(sysRoot string) UpdaterServiceInterface
Click to show internal directories.
Click to hide internal directories.