Documentation ¶
Index ¶
- func CheckSudo(password string) bool
- func CurlToSave(url, filename string, cover bool) bool
- func DeleteFile(file string) (bool, error)
- func Developer() bool
- func DpkgCheckInstalledKey(pac1, pac2 string) (bool, string)
- func DpkgCheckPackageVersion(package_ string, version string) (status_ bool, ver_ string)
- func DpkgConfig(password string) *dpkg
- func DpkgGetPackageStatus(pac_package string) (res map[string]string, status bool)
- func DpkgInstalled(pac_package string) bool
- func Exists(path string) (bool, error)
- func GetOsInfo() (os_type, os_arch string, os_version int)
- func GetUserInfo(display bool) (ok bool, username string, userid int, UserHome string)
- func IsDir(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func ListToString(ls list.List, seq string) string
- func Mkdir(dir string, mode fs.FileMode) (bool, error)
- func ReadLine(line int, filename string) (string, error)
- func ReadOnlyAll(filename string) (string, error)
- func RemoveIndexList(l []string, index int) []string
- func RemoveNullList(l []string) []string
- func RemoveValueList(l []string, v string) []string
- func SliceAppend(ls []string, v string) []string
- func SliceToString(ls []string, sep string) string
- func Version()
- func WgetToSave(url, filename string) bool
- func WriteTxtAppend(text, filename string, wrap bool) (res bool, err error)
- func WriteTxtCover(text, filename string, wrap bool) (res bool, err error)
- type AptPassword
- func (a *AptPassword) AptInstall(packages string) bool
- func (a *AptPassword) AptInstallList(pac_list list.List) (ok, failed list.List)
- func (a *AptPassword) AptInstallSlice(pac_list []string) (ok, failed list.List)
- func (a *AptPassword) AptLocalInstallFile(filename, name string) bool
- func (a *AptPassword) AptLocalInstallStr(install_str, name string) bool
- func (a *AptPassword) AptUninstall(pac_package string, name string) bool
- func (a *AptPassword) AptUninstallList(pac_list list.List) (ok, failed list.List)
- func (a *AptPassword) AptUninstallSclice(pac_list []string) (ok, failed list.List)
- func (a *AptPassword) AptUpdateIndex() bool
- func (a *AptPassword) AptUpgrade() bool
- func (a *AptPassword) LocalInsallList(file_list []string, name string) bool
- type NetDevice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurlToSave ¶
使用Curk下载文件到指定路径(cover是否覆盖已有文件)
func DpkgCheckInstalledKey ¶ added in v1.3.3
使用两个关键词查询本地是否已安装某个软件包
func DpkgCheckPackageVersion ¶
使用dpkg检查本地安装版本与标准版本是否一致
func DpkgGetPackageStatus ¶
使用 Dpkg查询包状态, 通过res返回字典,通过status返回查询状态,字典key(status/name/version)
func GetUserInfo ¶
获取当前系统环境信息(display: 是否显示信息)
func ListToString ¶
列表转字符串(seq: 拼接符,可以用: 空格 / _ @ 之类,具体请以实际需求设置)
func SliceToString ¶
字符串列表转字符串(seq: 拼接符,可以用: 空格 / _ @ 之类,具体请以实际需求设置)
func WriteTxtAppend ¶
追加方式写入文本(wrap: 是否在末尾追加换行符)
Types ¶
type AptPassword ¶
type AptPassword struct {
// contains filtered or unexported fields
}
定义一个命令行密码结构体
func (*AptPassword) AptInstallList ¶
func (a *AptPassword) AptInstallList(pac_list list.List) (ok, failed list.List)
通过apt安装包(列表传入)
func (*AptPassword) AptInstallSlice ¶
func (a *AptPassword) AptInstallSlice(pac_list []string) (ok, failed list.List)
通过apt安装包(切片传入) - 推荐
func (*AptPassword) AptLocalInstallFile ¶
func (a *AptPassword) AptLocalInstallFile(filename, name string) bool
使用apt安装本地文件(单个),安装之前将会检测文件是否存在
func (*AptPassword) AptLocalInstallStr ¶
func (a *AptPassword) AptLocalInstallStr(install_str, name string) bool
使用apt安装本地文件(字符串),直接安装,不会检测文件是否存在
func (*AptPassword) AptUninstall ¶
func (a *AptPassword) AptUninstall(pac_package string, name string) bool
通过apt卸载单个包
func (*AptPassword) AptUninstallList ¶
func (a *AptPassword) AptUninstallList(pac_list list.List) (ok, failed list.List)
通过apt卸载包(列表传入)
func (*AptPassword) AptUninstallSclice ¶
func (a *AptPassword) AptUninstallSclice(pac_list []string) (ok, failed list.List)
通过apt卸载包(列表传入)
func (*AptPassword) LocalInsallList ¶
func (a *AptPassword) LocalInsallList(file_list []string, name string) bool
使用apt安装本地文件(列表传入)
Click to show internal directories.
Click to hide internal directories.