No description
Find a file
Winni Neessen e42f8b3101
Fix missing HTTP response return in PastedAccount method.
Fixes #22

- In case of a HTTP error the PastedAccount method is supposed to return the HTTP response, since this can hold valuable information about the reason why the request failed. Instead, it was returning `nil`. This PR fixes this behaviour.
- Additionally, this PR introduces tests to catch such oversights
- Finally a proper `error.New()` error has been introduces, to that `error.Is()` can be used on common error that are detected by the module
2022-12-22 09:57:57 +01:00
.github Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
.idea Initial checkin 2021-09-19 18:10:12 +02:00
.cirrus.yml Make GoLinter happy 2021-09-21 11:26:48 +02:00
.gitignore Initial commit 2021-09-19 17:58:02 +02:00
.golangci.toml Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
breach.go Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
breach_test.go Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
codecov.yml Update codecov.yml 2022-05-07 14:59:31 +02:00
go.mod Initial checkin 2021-09-19 18:10:12 +02:00
hibp.go Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
hibp_test.go Better test coverage 2022-10-29 16:58:56 +02:00
LICENSE Initial commit 2021-09-19 17:58:02 +02:00
password.go Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
password_test.go Implement a golangci-lint workflow and the accordingly GH action 2022-10-29 15:32:12 +02:00
paste.go Fix missing HTTP response return in PastedAccount method. 2022-12-22 09:57:57 +01:00
paste_test.go Fix missing HTTP response return in PastedAccount method. 2022-12-22 09:57:57 +01:00
README.md Update README.md 2022-05-09 09:14:11 +02:00
sonar-project.properties Update sonar-project.properties 2022-04-13 09:42:37 +02:00

go-hibp - Simple Go binding to the "Have I Been Pwned" API

GoDoc Go Report Card Build Status codecov Mentioned in Awesome Go buy ma a coffee

This Go library provides simple bindings to the excellent "Have I Been Pwned" (HIBP) API by Troy Hunt. It implements all 3 APIs that are provided by HIBP (Breaches, Pastes, Passwords). API key support for the private API endpoints are supported as well. go-hibp follows idiomatic Go style and best practice. It's only dependency is the Go Standard Library.

Usage

The library is fully documented using the execellent GoDoc functionality. Check out the GoDocs Reference for details on how to implement access to any of the 3 APIs with this package. You will also find GoDoc code examples there for each of those APIs.