Add timestamp to scan results cache

This commit is contained in:
Chris Harris 2024-06-28 12:13:17 -04:00
parent 5f86f9a378
commit 6aeffc92f1
No known key found for this signature in database
GPG key ID: 9DAE9BAB4FBA0FEE
4 changed files with 17 additions and 12 deletions

View file

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/OpenCHAMI/magellan/internal/db/sqlite"
@ -25,7 +26,7 @@ var listCmd = &cobra.Command{
fmt.Printf("%s\n", string(b))
} else {
for _, r := range probeResults {
fmt.Printf("%s:%d (%s)\n", r.Host, r.Port, r.Protocol)
fmt.Printf("%s:%d (%s) @ %s\n", r.Host, r.Port, r.Protocol, r.Timestamp.Format(time.UnixDate))
}
}
},

View file

@ -7,6 +7,7 @@ import (
"os"
"path"
"strings"
"time"
magellan "github.com/OpenCHAMI/magellan/internal"
"github.com/OpenCHAMI/magellan/internal/db/sqlite"
@ -76,7 +77,7 @@ var scanCmd = &cobra.Command{
fmt.Printf("%s\n", string(b))
} else {
for _, r := range probeStates {
fmt.Printf("%s:%d (%s)\n", r.Host, r.Port, r.Protocol)
fmt.Printf("%s:%d (%s) @ %s\n", r.Host, r.Port, r.Protocol, r.Timestamp.Format(time.UnixDate))
}
}
}