Documentation
¶
Index ¶
- Constants
- Variables
- func GetDuration(t int64, v string) time.Duration
- func GetLocation() (*time.Location, error)
- func GetMacAddr() string
- func IsPortInUse(host string, port int64) bool
- func LocalIP(network string) string
- func OverTimeNow(compareTime, subTime time.Time, sub int64) (bool, int64, error)
- func ShanghaiLocation() (*time.Location, error)
- func SleepRandomDuration()
- func UpTime() time.Duration
- func UpTimeString() string
- type Cli
- type DateTime
- type DeviceMem
Constants ¶
View Source
const ( DateLayout = "2006-01-02" DateTimeLayout = "2006-01-02 15:04:05" TimeLayout = "15:04:05" BuildTimeLayout = "2006.0102.150405" TimestampLayout = "20060102150405" )
日期格式
Variables ¶
View Source
var ( ErrConnectFail = errors.New("SSH 连接失败") ErrNewSessionFail = errors.New("SSH 新建会话失败") ErrRunCommandFail = errors.New("SSH 执行命令失败") )
View Source
var StartTime = time.Now()
Functions ¶
func GetLocation ¶
func GetMacAddr ¶ added in v0.1.34
func GetMacAddr() string
func IsPortInUse ¶ added in v0.0.4
func OverTimeNow ¶
OverTimeNow 超时比较
func ShanghaiLocation ¶ added in v0.1.44
func SleepRandomDuration ¶
func SleepRandomDuration()
func UpTimeString ¶
func UpTimeString() string
Types ¶
type Cli ¶ added in v0.0.2
type Cli struct { IP string //IP地址 Username string //用户名 Password string //密码 Port int //端口号 LastResult string //最近一次Run的结果 Debug bool // contains filtered or unexported fields }
func NewSSH ¶ added in v0.0.2
创建命令行对象 @param ip IP地址 @param username 用户名 @param password 密码 @param debug 是否调试 @param port 端口号,默认22
func (*Cli) GetCpuTemp ¶ added in v0.0.8
GetCpuTemp CPU温度
func (*Cli) GetDatetime ¶ added in v0.0.2
GetDatetime 当前时间
Click to show internal directories.
Click to hide internal directories.