https://github.com/duguying/gomtr
gomtr is a golang wrapper for mtr-packet
https://github.com/duguying/gomtr
golang mtr wrapper
Last synced: 6 months ago
JSON representation
gomtr is a golang wrapper for mtr-packet
- Host: GitHub
- URL: https://github.com/duguying/gomtr
- Owner: duguying
- Created: 2017-03-03T09:31:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T06:14:23.000Z (over 7 years ago)
- Last Synced: 2025-04-10T06:30:02.172Z (6 months ago)
- Topics: golang, mtr, wrapper
- Language: Go
- Homepage:
- Size: 61.5 KB
- Stars: 9
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gomtr [](https://travis-ci.org/duguying/gomtr)
gomtr is a golang wrap for mtr-packet with born for solve concurrency mtr calling.
### usage
```golang
package mainimport (
"fmt"
"github.com/duguying/gomtr"
"github.com/gogather/com/log"
"time"
)func main() {
mtr := gomtr.NewMtrService("./mtr-packet")
go mtr.Start()time.Sleep(time.Second * 10)
iplist := []string{"183.131.7.130", "127.0.0.1", "114.215.151.25", "111.13.101.208"}
for i := 0; i < len(iplist); i++ {
mtr.Request(iplist[i], 10, func(response interface{}) {
task := response.(*gomtr.MtrTask)
log.Blueln("[ID]", i)
fmt.Println(task.GetSummaryString())
})
}
}```
### license
MIT License