Documentation ¶
Index ¶
- Constants
- func GetOemRepoInfo(dir string) (*OemRepoConfig, *OemRepoConfig)
- type Config
- func (c *Config) ConnectConfigChanged(key string, cb func(LastoreDaemonStatus, interface{}))
- func (c *Config) GetLastoreDaemonStatus() LastoreDaemonStatus
- func (c *Config) GetLastoreDaemonStatusByBit(key LastoreDaemonStatus) LastoreDaemonStatus
- func (c *Config) GetPlatformStatusDisable(status DisabledStatus) bool
- func (c *Config) ReloadSourcesDir()
- func (c *Config) SetAllowInstallRemovePkgExecPaths(paths []string) error
- func (c *Config) SetAllowPostSystemUpgradeMessageVersion(version []string) error
- func (c *Config) SetAppstoreRegion(region string) error
- func (c *Config) SetAutoCheckUpdates(enable bool) error
- func (c *Config) SetAutoClean(enable bool) error
- func (c *Config) SetAutoDownloadUpdates(enable bool) error
- func (c *Config) SetAutoInstallUpdateType(updateType system.UpdateType) error
- func (c *Config) SetAutoInstallUpdates(autoInstall bool) error
- func (c *Config) SetCheckInterval(interval time.Duration) error
- func (c *Config) SetCheckUpdateMode(mode system.UpdateType) error
- func (c *Config) SetClassifiedUpdatablePackages(pkgMap map[string][]string) error
- func (c *Config) SetCleanInterval(interval time.Duration) error
- func (c *Config) SetCleanIntervalCacheOverLimit(duration time.Duration) error
- func (c *Config) SetDisableUpdateMetadata(disable bool) error
- func (c *Config) SetDownloadSpeedLimitConfig(config string) error
- func (c *Config) SetIdleDownloadConfig(idleConfig string) error
- func (c *Config) SetInstallUpdateTime(delayed string) error
- func (c *Config) SetLastoreDaemonStatus(status LastoreDaemonStatus) error
- func (c *Config) SetMirrorSource(id string) error
- func (c *Config) SetMirrorsUrl(mirrorsUrl string) error
- func (c *Config) SetOnlineCache(cache string) error
- func (c *Config) SetRepository(repository string) error
- func (c *Config) SetSecurityCustomSource(sources []string) error
- func (c *Config) SetSecurityRepoType(typ RepoType) error
- func (c *Config) SetSystemCustomSource(sources []string) error
- func (c *Config) SetSystemRepoType(typ RepoType) error
- func (c *Config) SetUpdateMode(mode system.UpdateType) error
- func (c *Config) SetUpdateNotify(enable bool) error
- func (c *Config) SetUpdateStatus(status string) error
- func (c *Config) SetUpgradeStatusAndReason(status system.UpgradeStatusAndReason) error
- func (c *Config) SetUseDSettings(use bool) error
- func (c *Config) SetVersion(version string) error
- func (c *Config) UpdateLastCheckCacheSizeTime() error
- func (c *Config) UpdateLastCheckTime() error
- func (c *Config) UpdateLastCleanTime() error
- func (c *Config) UpdateLastoreDaemonStatus(status LastoreDaemonStatus, isSet bool) error
- type DisabledStatus
- type LastoreDaemonStatus
- type OemRepoConfig
- type RepoType
Constants ¶
View Source
const ( OemRepoDirPath = "/etc/deepin/lastore-daemon/oem-repo.conf.d/" UseOemSystemRepoFlagFile = ".use_oem_system_source_flag" UseOemSecurityRepoFlagFile = ".use_oem_security_source_flag" BackupOemSystemSourceListFilePath = "/etc/apt/sources.list.bak_oem" BackupOemSecuritySourceListFilePath = " /etc/apt/sources.list.d/security.list.bak_oem" )
View Source
const ConfigVersion = "0.1"
View Source
const (
DSettingsKeyLastoreDaemonStatus = "lastore-daemon-status"
)
View Source
const MinCheckInterval = time.Minute
Variables ¶
This section is empty.
Functions ¶
func GetOemRepoInfo ¶
func GetOemRepoInfo(dir string) (*OemRepoConfig, *OemRepoConfig)
GetOemRepoInfo 获取系统和安全仓库OEM配置
Types ¶
type Config ¶
type Config struct { Version string AutoCheckUpdates bool DisableUpdateMetadata bool AutoDownloadUpdates bool AutoClean bool MirrorSource string UpdateNotify bool CheckInterval time.Duration CleanInterval time.Duration UpdateMode system.UpdateType CheckUpdateMode system.UpdateType // 缓存大小超出限制时的清理时间间隔 CleanIntervalCacheOverLimit time.Duration AppstoreRegion string LastCheckTime time.Time LastCleanTime time.Time LastCheckCacheSizeTime time.Time Repository string MirrorsUrl string AllowInstallRemovePkgExecPaths []string AutoInstallUpdates bool AutoInstallUpdateType system.UpdateType AllowPostSystemUpgradeMessageVersion []string // 只有数组内的系统版本被允许发送更新完成的数据 UpgradeStatus system.UpgradeStatusAndReason IdleDownloadConfig string SystemSourceList []string // 系统更新list文件路径 SecuritySourceList []string // 安全更新list文件路径 NonUnknownList []string // 非未知来源更新list文件 OtherSourceList []string // 其他类型更新list文件路径 DownloadSpeedLimitConfig string UpdateStatus string PlatformUpdate bool PlatformUrl string // 更新接口地址 CheckPolicyCron string // 策略检查间隔 StartCheckRange []int // 开机检查更新区间 IncludeDiskInfo bool // machineID是否包含硬盘信息 PostUpgradeCron string // 更新上报间隔 UpdateTime string // 定时更新 PlatformDisabled DisabledStatus EnableVersionCheck bool ClassifiedUpdatablePackages map[string][]string OnlineCache string EnableCoreList bool ClientPackageName string SystemCustomSource []string // 系统更新自定义仓库内容 SecurityCustomSource []string // 安全更新自定义仓库内容 SystemOemSourceConfig OemRepoConfig // 系统更新OEM仓库配置 来源/etc/deepin/lastore-daemon/oem-repo.conf.d SecurityOemSourceConfig OemRepoConfig // 安全更新OEM仓库配置 来源/etc/deepin/lastore-daemon/oem-repo.conf.d SystemRepoType RepoType // 系统更新仓库类型 SecurityRepoType RepoType // 安全更新仓库类型 // contains filtered or unexported fields }
func (*Config) ConnectConfigChanged ¶
func (c *Config) ConnectConfigChanged(key string, cb func(LastoreDaemonStatus, interface{}))
func (*Config) GetLastoreDaemonStatus ¶
func (c *Config) GetLastoreDaemonStatus() LastoreDaemonStatus
func (*Config) GetLastoreDaemonStatusByBit ¶
func (c *Config) GetLastoreDaemonStatusByBit(key LastoreDaemonStatus) LastoreDaemonStatus
func (*Config) GetPlatformStatusDisable ¶
func (c *Config) GetPlatformStatusDisable(status DisabledStatus) bool
func (*Config) ReloadSourcesDir ¶
func (c *Config) ReloadSourcesDir()
ReloadSourcesDir 更新系统、安全仓库list文件,/var/lib/lastore/SystemSource.d和/var/lib/lastore/SecuritySource.d
func (*Config) SetAllowInstallRemovePkgExecPaths ¶
func (*Config) SetAllowPostSystemUpgradeMessageVersion ¶
func (*Config) SetAppstoreRegion ¶
func (*Config) SetAutoCheckUpdates ¶
func (*Config) SetAutoClean ¶
func (*Config) SetAutoDownloadUpdates ¶
func (*Config) SetAutoInstallUpdateType ¶
func (c *Config) SetAutoInstallUpdateType(updateType system.UpdateType) error
func (*Config) SetAutoInstallUpdates ¶
func (*Config) SetCheckUpdateMode ¶
func (c *Config) SetCheckUpdateMode(mode system.UpdateType) error
func (*Config) SetClassifiedUpdatablePackages ¶
func (*Config) SetCleanIntervalCacheOverLimit ¶
func (*Config) SetDisableUpdateMetadata ¶
func (*Config) SetDownloadSpeedLimitConfig ¶
func (*Config) SetIdleDownloadConfig ¶
func (*Config) SetInstallUpdateTime ¶
func (*Config) SetLastoreDaemonStatus ¶
func (c *Config) SetLastoreDaemonStatus(status LastoreDaemonStatus) error
func (*Config) SetMirrorSource ¶
func (*Config) SetMirrorsUrl ¶
func (*Config) SetOnlineCache ¶
func (*Config) SetRepository ¶
func (*Config) SetSecurityCustomSource ¶
func (*Config) SetSecurityRepoType ¶
func (*Config) SetSystemCustomSource ¶
func (*Config) SetSystemRepoType ¶
func (*Config) SetUpdateMode ¶
func (c *Config) SetUpdateMode(mode system.UpdateType) error
func (*Config) SetUpdateNotify ¶
func (*Config) SetUpdateStatus ¶
func (*Config) SetUpgradeStatusAndReason ¶
func (c *Config) SetUpgradeStatusAndReason(status system.UpgradeStatusAndReason) error
func (*Config) SetUseDSettings ¶
func (*Config) SetVersion ¶
func (*Config) UpdateLastCheckCacheSizeTime ¶
func (*Config) UpdateLastCheckTime ¶
func (*Config) UpdateLastCleanTime ¶
func (*Config) UpdateLastoreDaemonStatus ¶
func (c *Config) UpdateLastoreDaemonStatus(status LastoreDaemonStatus, isSet bool) error
UpdateLastoreDaemonStatus isSet: true 该位置1; false 该位清零
type DisabledStatus ¶
type DisabledStatus uint32
const ( DisabledUnknown DisabledStatus = 1 << 0 // 禁用重启后的检查项,1063前的版本不兼容需要禁用 // 该配置项不作为配置生效 DisabledVersion DisabledStatus = 1 << 1 // 禁用version请求 DisabledUpdateLog DisabledStatus = 1 << 2 // 禁用systemupdatelogs请求 DisabledTargetPkgLists DisabledStatus = 1 << 3 DisabledCurrentPkgLists DisabledStatus = 1 << 4 DisabledPkgCVEs DisabledStatus = 1 << 5 DisabledProcess DisabledStatus = 1 << 6 DisabledResult DisabledStatus = 1 << 7 DisabledRebootCheck DisabledStatus = 1 << 8 // 禁用重启后的检查项,1063前的版本不兼容需要禁用 )
type LastoreDaemonStatus ¶
type LastoreDaemonStatus uint32
LastoreDaemonStatus 由于lastore-daemon会闲时退出,dde-session-shell和dde-control-center需要获取实时状态时需要从dconfig获取,而不是从lastore-daemon获取
const ( CanUpgrade LastoreDaemonStatus = 1 << 0 // 是否可以进行安装更新操作 DisableUpdate LastoreDaemonStatus = 1 << 1 // 当前系统是否禁用了更新 ForceUpdate LastoreDaemonStatus = 1 << 2 // 关机强制更新 )
type OemRepoConfig ¶
type OemRepoConfig struct { UpdateType system.UpdateType RepoShowNameZh string `json:"RepoShowName_zh"` RepoShowNameEn string `json:"RepoShowName_en"` RepoUrl []string // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.