Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateScript ¶ added in v1.5.8
CreateScript 创建Shell脚本文件
func GetUserInfo ¶
GetUserInfo 获取用户名,用户uid,用户家目录
Types ¶
type ApiShell ¶ added in v1.4.7
type ApiShell struct { Printer bool // 打印详细错误信息(默认: true) Prints bool // 是否打印详细信息(默认: false) Debug bool // 是否打印调试信息(默认: false) Realtime bool // 是否开启实时打印信息 Result bool // 是否执行成功 Text string // 需要执行的命令 OsType string // 系统类型 Strings string // 输出结果 ExitCode int // 命令执行退出代码 Err error // 错误 Slice []string // 数据切片 Script string // 脚本文件 ScriptMode bool // 脚本文件 // contains filtered or unexported fields }
ApiShell 定义命令的结构体
type ApiSudo ¶ added in v1.4.7
type ApiSudo struct { Printer bool // 打印详细错误信息(默认: true) Prints bool // 是否打印详细信息(默认: false) Debug bool // 是否打印调试信息(默认: false) Password string // sudo权限使用的密码 Realtime bool // 是否开启实时打印信息 Result bool // 是否执行成功 SudoPath string // sudo命令绝对路径 Text string // 需要执行的命令 OsType string // 系统类型 Shell ApiShell // 实例化Shell Strings string // 输出结果 ExitCode int // 命令执行退出代码 Err error // 错误 Slice []string // 数据切片 Script string // 脚本文件 ScriptMode bool // 脚本文件 // contains filtered or unexported fields }
ApiSudo 定义命令的结构体
func NewSudo ¶ added in v1.4.6
NewSudo 命令实例构造函数, 当不需要执行sudo命令的时候直接传入任意字符串给password即可 Realtime 是否开启实时打印数据
Click to show internal directories.
Click to hide internal directories.