package
module
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Mar 7, 2025
License: GPL-3.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
OSHelper
项目简介
OSHelper是一个开源项目,旨在通过SSH连接远程服务器,获取系统信息、管理软件包以及执行文件操作。该项目使用Go语言开发,主要功能包括获取系统详细版本信息、安装和管理软件包、下载和删除文件等。
功能特性
- 获取系统信息: 支持获取Linux和Mac系统的详细信息,包括系统版本、架构、内核版本等。
- 软件包管理: 支持CentOS和Debian系统的软件包安装、信息获取和文件列表获取。
- 文件操作: 支持远程文件的下载和删除操作。
- 网络测试: 提供简单的网络连通性测试功能。
安装与使用
-
安装OSHelper:
go get github.com/ChamHerry/oshelper
-
在你的Go项目中导入并使用OSHelper:
import "github.com/ChamHerry/oshelper"
-
运行示例:
package main
import (
"context"
"github.com/ChamHerry/oshelper/consts"
"github.com/ChamHerry/oshelper/controller"
"github.com/gogf/gf/v2/frame/g"
)
func main() {
ctx := context.Background()
SystemController, _ := controller.NewController(consts.SSHConfig{})
runCommand, err := SystemController.RunCommand(consts.RunCommandConfig{Command: "ls"})
if err != nil {
return
}
g.Log().Info(ctx, runCommand)
}
贡献
欢迎贡献!请阅读贡献指南以了解如何参与项目。
许可证
该项目基于GPL 3.0许可证进行许可。详细信息请参阅LICENSE文件。
Documentation
¶
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.