Debian Codegraph @

README.md

raw symbols SCIP
1 # pingscanner
2
3 Scanning alive hosts of the given CIDR range in parallel.
4
5 ## Usage
6
7 ```go
8 package main
9
10 import (
11 "fmt"
12
13 ps "github.com/kotakanbe/go-pingscanner"
14 )
15
16 func main() {
17 scanner := ps.PingScanner{
18 CIDR: "192.168.11.0/24",
19 PingOptions: []string{
20 "-c1",
21 "-t1",
22 },
23 NumOfConcurrency: 100,
24 }
25 if aliveIPs, err := scanner.Scan(); err != nil {
26 fmt.Println(err)
27 } else {
28 if len(aliveIPs) < 1 {
29 fmt.Println("no alive hosts")
30 }
31 for _, ip := range aliveIPs {
32 fmt.Println(ip)
33 }
34 }
35 }
36 ```
37
38 ## Author
39
40 [kotakanbe](https://github.com/kotakanbe)
41
42 ## License
43
44 Please see [LICENSE](https://github.com/kotakanbe/go-pingscanner/blob/master/LICENSE).