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 ExtractRAUCRelease(packageFilepath string, release codegen.Release) error
- func ExtractReleasePackages(packageFilepath string, release codegen.Release) error
- func GetChecksums(release codegen.Release) (map[string]string, error)
- func GetFileNameFromMigrationURL(url string) string
- func GetInstallMethod(sysRoot string) (string, error)
- 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 InstallCasaOSPackages(release codegen.Release, sysRoot string) error
- 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 InstallSystem(release codegen.Release, sysRoot 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 LoadReleaseFromLocal(sysRoot string) (*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 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 VerifyRelease(release codegen.Release) (string, error)
- func VerifyUninstallScript(sysRoot string) bool
- type EventType
- type InstallerServices
- 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) 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) MigrationInLaunch(sysRoot string) error
- func (r *RAUCService) VerifyRelease(release codegen.Release) (string, error)
- type Services
- type TarService
Constants ¶
View Source
const ( RAUCOfflinePath = "/Data/rauc/" RAUCOfflineReleaseFile = "release.yaml" RAUCOfflineRAUCFile = "rauc.tar.gz" )
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 ExtractRAUCRelease ¶ added in v0.2.0
func ExtractReleasePackages ¶
func GetInstallMethod ¶
func GetReleaseBranch ¶ added in v0.2.0
func InitEventTypeMapStatus ¶ added in v0.2.0
func InitEventTypeMapStatus()
func InstallCasaOSPackages ¶
dependent config.ServerInfo.CachePath
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 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 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 InstallerServices ¶
type InstallerServices 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 MigrationInLaunch(sysRoot string) error }
var InstallerService InstallerServices
func NewInstallerService ¶ added in v0.2.0
func NewInstallerService(sysRoot string) InstallerServices
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) 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) MigrationInLaunch ¶ added in v0.2.0
func (r *RAUCService) MigrationInLaunch(sysRoot string) error
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 TarService ¶ added in v0.2.0
type TarService struct { }
func (*TarService) GetRelease ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.