07c61c1b1c
First push for beginning of project
30 lines
636 B
Go
30 lines
636 B
Go
package alert
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"strings"
|
|
|
|
"git.tcp.direct/perp/shogo/internal/utils"
|
|
)
|
|
|
|
// Return alert information
|
|
func Info(id string) {
|
|
// Get results
|
|
results, err := utils.Client.GetAlert(context.Background(), id)
|
|
if err != nil {
|
|
fmt.Printf("%s: %s\n", utils.Red("Error"), err.Error())
|
|
return
|
|
}
|
|
|
|
// Print results
|
|
utils.Title.Printf("Alert %s\n", id)
|
|
fmt.Printf("%s: %s\n", utils.Green("Name"), utils.Blue(results.Name))
|
|
fmt.Printf(
|
|
"%s: %s\n",
|
|
utils.Blue("Network"),
|
|
utils.Green(strings.Join(results.Filters.IP, ",")),
|
|
)
|
|
fmt.Printf("%s: %s\n", utils.Green("Created"), utils.Blue(results.Created))
|
|
}
|