package
module
Version:
v0.0.0-...-d96257b
Opens a new window with list of versions in this module.
Published: Jun 3, 2019
License: MIT
Opens a new window with license information.
Imports: 15
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
go simple ping
简介
- 提供可视化的网络实时状况展示
- gui界面提供灵活的软件配置
- 可通过json配置测试主机列表
- 可通过json配置各项参数
- 提供一大堆go实现高效ping(支持多个ping并发)
预览
安装
issue
请提出宝贵意见 issue
使用
依赖
gui依赖于Gonum Plot
使用go get
工具进行安装源码
go get gonum.org/v1/plot/...
引入
import "github.com/intmian/goping"
接口
-
Ping(host string, c chan int, count int, size int, timeout int64, neverStop bool)
-
host
主机号
-
count
一次发送几个包
-
size
包大小
-
timeout
时间
-
neverStop
是否为永久的ping(一直ping,直到ctrl + c终止)
-
done chan bool
go Ping(host, done, count, timeout, neverStop)
<-done
-
会输出标准的ping信息(和系统自带的ping一样)
-
SimplePing(host string, c chan int)
-
func SimplePing(host string, c chan int) {
Ping(host, c, 4, 32, 1000, false)
}
-
PingInfo
-
PingInside(host string, c chan PingInfo, count int, size int, timeout int64, neverStop bool)
-
和之前的ping一样,不过数据以PingInfo形式输出
-
data chan bool
go Ping_inside(host, data, count, timeout, neverStop)
temp := <-data
print(temp.Average)
print(temp.LostRate)
-
PingInsideSimple(host string, c chan PingInfo)
-
func Ping_inside_simple(host string, c chan PingInfo) {
Ping_inside(host, c, 4, 32, 1000, false)
}
-
Gui()
Documentation
¶
Package goping 包含了各种ping及一个动态界面
-
func Gui()
-
func Ping(host string, c chan int, count int, size int, timeout int64, neverStop bool)
-
func PingInside(host string, c chan PingInfo, count int, size int, timeout int64, ...)
-
func PingInsideSimple(host string, c chan PingInfo)
-
func SimplePing(host string, c chan int)
-
type PingInfo
PingInside 是可以通过PingInfo返回结果的Ping 但是不能返回每次的结果
PingInsideSimple 是默认参数版的PingInside
PingInfo is
type PingInfo struct {
Average float32
LostRate float32
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.