Documentation ¶
Index ¶
- func CheckSudo(password string) bool
- func CurlToSave(url, filename string, cover bool) bool
- func Developer() bool
- func DpkgCheckInstalledKey(pac1, pac2 string, debug bool) (bool, string)
- func DpkgCheckPackageVersion(package_ string, version string) (status_ bool, ver_ string)
- func DpkgGetPackageStatus(pacPackage string) (m map[string]string, err error)
- func DpkgInstalled(pacPackage string) bool
- func GetOsInfo() (osType, osArch string, osVersion int)
- func GetUserInfo(display bool) (ok bool, username string, userid int, UserHome string)
- func IsIPv4(ipAddr string) bool
- func IsLoopbackV4(ipAddr string) bool
- func Version()
- func WgetToSave(url, filename string) bool
- type ApiApt
- func (a *ApiApt) AptInstall(Package string) (res bool)
- func (a *ApiApt) AptInstallList(pacList list.List) (ok, failed list.List)
- func (a *ApiApt) AptInstallSlice(pacList []string) (ok, failed list.List)
- func (a *ApiApt) AptLocalInstallFile(filename, name string) (err error)
- func (a *ApiApt) AptLocalInstallStr(installStr, name string) bool
- func (a *ApiApt) AptUninstall(Package string, name string) (res bool)
- func (a *ApiApt) AptUninstallList(pacList list.List) (ok, failed list.List)
- func (a *ApiApt) AptUninstallSlice(pacList []string) (ok, failed list.List)
- func (a *ApiApt) AptUpdateIndex() (res bool)
- func (a *ApiApt) AptUpgrade() (res bool)
- func (a *ApiApt) LocalInstallList(fileList []string, name string) bool
- type ApiConnection
- type ApiDpkg
- func (dp *ApiDpkg) DpkgConfigureAll() bool
- func (dp *ApiDpkg) DpkgLocalInstallFile(pac string, name string) bool
- func (dp *ApiDpkg) DpkgLocalInstallList(fileList list.List, name string) bool
- func (dp *ApiDpkg) DpkgUninstallList(pacList list.List) bool
- func (dp *ApiDpkg) DpkgUninstallPackage(Package string) bool
- type ApiEth
- type ApiNmcli
- type ApiService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurlToSave ¶
CurlToSave 使用Curl下载文件到指定路径(cover是否覆盖已有文件)
func DpkgCheckInstalledKey ¶ added in v1.3.3
DpkgCheckInstalledKey 使用两个关键词查询本地是否已安装某个软件包
func DpkgCheckPackageVersion ¶
DpkgCheckPackageVersion 使用dpkg检查本地安装版本与标准版本是否一致
func DpkgGetPackageStatus ¶
DpkgGetPackageStatus 使用 Dpkg查询包状态, 通过res返回字典,通过status返回查询状态,字典key(status/Name/version)
func GetUserInfo ¶
GetUserInfo 获取当前系统环境信息(display: 是否显示信息)
Types ¶
type ApiApt ¶ added in v1.5.6
type ApiApt struct { Sudo gcs.SudoConfig // 执行sudo命令 // contains filtered or unexported fields }
ApiApt 定义一个命令行密码结构体
func (*ApiApt) AptInstall ¶ added in v1.5.6
AptInstall 使用apt在线安装包
func (*ApiApt) AptInstallList ¶ added in v1.5.6
AptInstallList 通过apt安装包(列表传入)
func (*ApiApt) AptInstallSlice ¶ added in v1.5.6
AptInstallSlice 通过apt安装包(切片传入) - 推荐
func (*ApiApt) AptLocalInstallFile ¶ added in v1.5.6
AptLocalInstallFile 使用apt安装本地文件(单个),安装之前将会检测文件是否存在
func (*ApiApt) AptLocalInstallStr ¶ added in v1.5.6
AptLocalInstallStr 使用apt安装本地文件(字符串),直接安装,不会检测文件是否存在
func (*ApiApt) AptUninstall ¶ added in v1.5.6
AptUninstall 通过apt卸载单个包
func (*ApiApt) AptUninstallList ¶ added in v1.5.6
AptUninstallList 通过apt卸载包(列表传入)
func (*ApiApt) AptUninstallSlice ¶ added in v1.5.6
AptUninstallSlice 通过apt卸载包(列表传入)
func (*ApiApt) AptUpdateIndex ¶ added in v1.5.6
AptUpdateIndex 更新索引
func (*ApiApt) AptUpgrade ¶ added in v1.5.6
AptUpgrade 更新系统
type ApiConnection ¶ added in v1.5.6
type ApiConnection struct { Name string // 连接名称(例如: dhcp) Types string // 连接类型(bridge/wifi/ethernet) Method string // 连接模式(auto) Dns []string // DNS列表 Dev string // 设备名称 Gw string // 网关地址 Address string // IP地址 Mask int // 子网掩码 // contains filtered or unexported fields }
func (*ApiConnection) AddConnect ¶ added in v1.5.6
func (c *ApiConnection) AddConnect() error
AddConnect 新增连接
func (*ApiConnection) AddDns ¶ added in v1.5.6
func (c *ApiConnection) AddDns() (err error)
AddDns 增加DNS,默认(119.29.29.29 180.76.76.76)
type ApiDpkg ¶ added in v1.5.6
type ApiDpkg struct { Sudo gcs.SudoConfig // 执行sudo命令 // contains filtered or unexported fields }
ApiDpkg 定义一个Dpkg管理结构
func (*ApiDpkg) DpkgConfigureAll ¶ added in v1.5.6
DpkgConfigureAll 使用 Dpkg --configure -a继续配置
func (*ApiDpkg) DpkgLocalInstallFile ¶ added in v1.5.6
DpkgLocalInstallFile 使用 Dpkg安装本地文件
func (*ApiDpkg) DpkgLocalInstallList ¶ added in v1.5.6
DpkgLocalInstallList 使用 Dpkg安装本地文件(列表传入)
func (*ApiDpkg) DpkgUninstallList ¶ added in v1.5.6
DpkgUninstallList 使用 Dpkg卸载包(列表传入)
func (*ApiDpkg) DpkgUninstallPackage ¶ added in v1.5.6
DpkgUninstallPackage 使用 Dpkg卸载单个包
type ApiEth ¶ added in v1.5.6
type ApiEth struct { Index int // 网卡设备索引 Name string // 网卡名称 Ipv4 string // IPV4地址 Mask int //子网掩码 Mac string // Mac物理地址 }
ApiEth 网卡信息结构体
type ApiNmcli ¶ added in v1.5.6
type ApiNmcli struct { DefaultGw string // 当前默认网关 DefaultDevices string // 当前默认网卡设备 // contains filtered or unexported fields }
ApiNmcli 网卡管理
func (*ApiNmcli) GetConnectionList ¶ added in v1.5.6
GetConnectionList 获取指定设备及类型的连接列表
func (*ApiNmcli) GetDefaultGw ¶ added in v1.5.6
GetDefaultGw 获取默认网关/网卡设备
func (*ApiNmcli) GetEthInfo ¶ added in v1.5.6
GetEthInfo 获取所有网卡信息(IPV4)
type ApiService ¶ added in v1.5.6
type ApiService struct { Name string // 服务名称 Err error //错误 Status string // 当前状态 Password string // Sudo权限密码 // contains filtered or unexported fields }
func NewService ¶ added in v1.5.5
func NewService(name string) *ApiService
func (*ApiService) ReLoad ¶ added in v1.5.6
func (api *ApiService) ReLoad() *ApiService
func (*ApiService) ReLoadDaemon ¶ added in v1.5.6
func (api *ApiService) ReLoadDaemon() *ApiService
func (*ApiService) ReStart ¶ added in v1.5.6
func (api *ApiService) ReStart()
func (*ApiService) Start ¶ added in v1.5.6
func (api *ApiService) Start()
func (*ApiService) Stop ¶ added in v1.5.6
func (api *ApiService) Stop()