Documentation ¶
Overview ¶
This is system package manager need implement for porting lastore-daemon
Index ¶
- Constants
- Variables
- func DecodeJson(fpath string, d interface{}) error
- func EncodeJson(fpath string, d interface{}) error
- func ListPackageFile(packages ...string) []string
- func NormalFileExists(fpath string) bool
- func QueryPackageDependencies(pkgId string) []string
- func QueryPackageDownloadSize(packages ...string) (float64, error)
- func QueryPackageInstallable(pkgId string) bool
- func QueryPackageInstalled(pkgId string) bool
- type Architecture
- type DirMonitor
- type DirMonitorCallback
- type DirMonitorChangeType
- type Indicator
- type JobError
- type JobProgressInfo
- type MirrorSource
- type NotFoundErrorType
- type PkgSystemError
- type RepositoryInfo
- type Status
- type System
- type UpdateInfoError
- type UpgradeInfo
Constants ¶
View Source
const ( DownloadJobType = "download" InstallJobType = "install" RemoveJobType = "remove" UpdateJobType = "update" DistUpgradeJobType = "dist_upgrade" PrepareDistUpgradeJobType = "prepare_dist_upgrade" UpdateSourceJobType = "update_source" CleanJobType = "clean" FixErrorJobType = "fix_error" )
View Source
const ( ErrTypeDpkgInterrupted = "dpkgInterrupted" ErrTypeDependenciesBroken = "dependenciesBroken" ErrTypeUnknown = "unknown" ErrTypeInvalidSourcesList = "invalidSourceList" )
View Source
const DefaultMirrorsUrl = "http://packages.deepin.com/mirrors/community.json"
View Source
const SizeDownloaded = 0
View Source
const SizeUnknown = -1
View Source
const VarLibDir = "/var/lib/lastore"
Variables ¶
View Source
var NotImplementError = errors.New("not implement")
View Source
var NotSupportError = errors.New("not support operation")
View Source
var RepoInfos []RepositoryInfo
View Source
var ResourceExitError = errors.New("resource exists")
Functions ¶
func DecodeJson ¶
func EncodeJson ¶
func ListPackageFile ¶
ListPackageFile list files path contained in the packages
func NormalFileExists ¶
func QueryPackageDependencies ¶
QueryPackageDependencies return the directly dependencies
func QueryPackageDownloadSize ¶
QueryPackageDownloadSize parsing the total size of download archives when installing the packages.
func QueryPackageInstallable ¶
QueryPackageInstallable query whether the pkgId can be installed
func QueryPackageInstalled ¶
QueryPackageInstalled query whether the pkgId installed
Types ¶
type Architecture ¶
type Architecture string
func SystemArchitectures ¶
func SystemArchitectures() ([]Architecture, error)
SystemArchitectures return the system package manager supported architectures
type DirMonitor ¶
func NewDirMonitor ¶
func NewDirMonitor(baseDir string) *DirMonitor
func (*DirMonitor) Add ¶
func (f *DirMonitor) Add(fn DirMonitorCallback, names ...string) error
func (*DirMonitor) Start ¶
func (f *DirMonitor) Start() error
func (*DirMonitor) Stop ¶
func (f *DirMonitor) Stop()
type DirMonitorCallback ¶
type DirMonitorCallback func(fpath string)
type DirMonitorChangeType ¶
type DirMonitorChangeType string
type Indicator ¶
type Indicator func(JobProgressInfo)
type JobProgressInfo ¶
type MirrorSource ¶
type NotFoundErrorType ¶
type NotFoundErrorType string
func NotFoundError ¶
func NotFoundError(w string) NotFoundErrorType
func (NotFoundErrorType) Error ¶
func (e NotFoundErrorType) Error() string
type PkgSystemError ¶
func (*PkgSystemError) Error ¶
func (e *PkgSystemError) Error() string
func (*PkgSystemError) GetDetail ¶
func (e *PkgSystemError) GetDetail() string
func (*PkgSystemError) GetType ¶
func (e *PkgSystemError) GetType() string
type RepositoryInfo ¶
type RepositoryInfo struct { Name string `json:"name"` Url string `json:"url"` Mirror string `json:"mirror"` }
func DetectDefaultRepoInfo ¶
func DetectDefaultRepoInfo(rInfos []RepositoryInfo) RepositoryInfo
type System ¶
type System interface { Download(jobId string, packages []string) error Install(jobId string, packages []string, environ map[string]string) error Remove(jobId string, packages []string, environ map[string]string) error DistUpgrade(jobId string, environ map[string]string) error UpdateSource(jobId string) error Clean(jobId string) error Abort(jobId string) error AttachIndicator(Indicator) FixError(jobId string, errType string, environ map[string]string) error }
type UpdateInfoError ¶
func (*UpdateInfoError) Error ¶
func (err *UpdateInfoError) Error() string
type UpgradeInfo ¶
type UpgradeInfo struct { Package string CurrentVersion string LastVersion string ChangeLog string }
func SystemUpgradeInfo ¶
func SystemUpgradeInfo() ([]UpgradeInfo, error)
Click to show internal directories.
Click to hide internal directories.