mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Add timestamp to scan results cache
This commit is contained in:
parent
5f86f9a378
commit
6aeffc92f1
4 changed files with 17 additions and 12 deletions
|
|
@ -12,20 +12,22 @@ import (
|
|||
)
|
||||
|
||||
type ScannedResult struct {
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
State bool `json:"state"`
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
State bool `json:"state"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
}
|
||||
|
||||
func rawConnect(host string, ports []int, timeout int, keepOpenOnly bool) []ScannedResult {
|
||||
results := []ScannedResult{}
|
||||
for _, p := range ports {
|
||||
result := ScannedResult{
|
||||
Host: host,
|
||||
Port: p,
|
||||
Protocol: "tcp",
|
||||
State: false,
|
||||
Host: host,
|
||||
Port: p,
|
||||
Protocol: "tcp",
|
||||
State: false,
|
||||
Timestamp: time.Now(),
|
||||
}
|
||||
t := time.Second * time.Duration(timeout)
|
||||
port := fmt.Sprint(p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue