common

package
v0.4.3-0...-fd7f253 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADDRESS         string = "0.0.0.0:65512"
	SERVER_LIST_API string = "/json/serverlist"
	PUBLICKEY_API   string = "/json/publickey"
	TESTMODE        bool   = false
)

Variables

View Source
var (
	// M 安全锁
	M *sync.Mutex
	// Cmd agent进程
	Cmd *exec.Cmd
	// Service daemon服务
	Service service.Service
	// ServerIP 服务IP地址
	ServerIP string
	// AgentStatus agent状态,是否启动中
	AgentStatus bool
	// InstallPath agent安装目录
	InstallPath string
	// Arch 系统位数
	Arch string
	// PublicKey 与Server通讯公钥
	PublicKey string
	// HTTPClient httpclient
	HTTPClient *http.Client
	// Proto 请求协议,测试模式为HTTP
	Proto string
)

Functions

func CmdExec

func CmdExec(cmd string) (string, error)

CmdExec 执行系统命令

func InArray

func InArray(list []string, value string, like bool) bool

InArray 判断值是否存在于指定列表中,like为true则为包含判断

func KillAgent

func KillAgent() error

KillAgent 结束agent

Types

This section is empty.

Jump to

Keyboard shortcuts

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