gcs

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 3

README

gcs

介绍

使用Golang编写的命令模块

安装教程

待更新

使用说明

待更新

三方模块

  • gitee.com/liumou_site/logger v1.1.1 // indirect
  • github.com/spf13/cast v1.5.0 // indirec

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCmd

func CheckCmd(cmd string) bool

检查命令是否存在

func GetUserInfo

func GetUserInfo(display bool) (ok bool, username string, userid int, UserHome string)

func Version

func Version()

Types

type ShellDebug

type ShellDebug struct {
	// contains filtered or unexported fields
}

定义命令的结构体

func ShellInit

func ShellInit(debug, prints, ptinter bool, password string) *ShellDebug

命令实例构造函数, 当不需要执行sudo命令的时候直接传入任意字符串给password即可

func (*ShellDebug) GetStatusOutputBool

func (shells *ShellDebug) GetStatusOutputBool(cmd string) (bool, string, error)

执行命令并获取输出数据, 返回执行结果布尔值 - (成功/失败)及 命令输出 (字符串)

func (*ShellDebug) ScriptGetStatusOutput

func (shells *ShellDebug) ScriptGetStatusOutput(cmds string) (excode int, out string, err error)

使用第三方脚本二次开发

func (*ShellDebug) Shell

func (shells *ShellDebug) Shell(command string) bool

执行命令并获取执行结果, 返回执行结果(成功/失败)

func (*ShellDebug) ShellGetOutSudo

func (shells *ShellDebug) ShellGetOutSudo(cmd string) (bool, string)

通过Sudo权限执行命令并获取输出数据, 返回执行结果(成功/失败)及命令输出(字符串)

func (*ShellDebug) ShellSudo

func (shells *ShellDebug) ShellSudo(command string) bool

执行命令并获取执行结果, 返回执行结果(成功/失败)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL