go-hibp/examples/breaches-api/all-breaches/main.go

21 lines
388 B
Go
Raw Normal View History

2021-09-22 09:46:18 +02:00
package main
import (
"fmt"
"github.com/wneessen/go-hibp"
2021-09-22 09:46:18 +02:00
)
func main() {
hc := hibp.New()
bl, _, err := hc.BreachApi.Breaches()
if err != nil {
panic(err)
}
if bl != nil && len(bl) != 0 {
for _, b := range bl {
fmt.Printf("Found breach:\n\tName: %s\n\tDomain: %s\n\tBreach date: %s\n\n",
b.Name, b.Domain, b.BreachDate.Time().Format("Mon, 2. January 2006"))
}
}
}