Documentation ¶
Index ¶
- Constants
- type Magnet
- func (m *Magnet) Close() error
- func (m *Magnet) GetPackage(name string) []installer.Package
- func (m *Magnet) Install(path string, flag int) (installer.Package, error)
- func (m *Magnet) ListPackage() []installer.Package
- func (m *Magnet) ReadInfo(path string) (pkg installer.PackageInfo, err error)
- func (m *Magnet) Uninstall(name string, delPkg bool) error
- func (m *Magnet) UninstallPkgs(delPkg bool, pkgs ...installer.Package) (err error)
- type Opt
- func Default(installDir, recordFile string) Opt
- func SetInstallStrategy(s installer.Strategy) Opt
- func SetInstaller(i installer.Installer) Opt
- func SetListener(l watcher.PackageListener) Opt
- func SetLogger(l xlog.Logger) Opt
- func SetRecorder(r installer.Recorder) Opt
- func SetWatchFactory(fac watcher.Factory) Opt
Constants ¶
View Source
const ( // 如果不存在则安装 InstallFlagNotExists = 0 // 使用新版本覆盖安装 InstallFlagNewVersion = 1 // 强制安装,不做任何检查 InstallFlagForce = 1 << 1 // 卸载已存在的所有安装包 InstallFlagUninstallExists = 1 << 2 // 卸载已存在的旧版本 InstallFlagUninstallOld = 1 << 3 // 当需要卸载时,使用异步方式卸载 InstallFlagAsyncUninstall = 1 << 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Magnet ¶
type Magnet struct {
// contains filtered or unexported fields
}
func (*Magnet) GetPackage ¶
根据安装包名称获得安装信息
func (*Magnet) ReadInfo ¶
func (m *Magnet) ReadInfo(path string) (pkg installer.PackageInfo, err error)
获得安装包信息 param: path安装包路径
Click to show internal directories.
Click to hide internal directories.