Documentation ¶
Overview ¶
Package pwnedpass provides a library for accessing the Pwned Password API.
Usage:
count, err := pwnedpass.DefaultClient.Count("password") if err != nil { panic(err) } fmt.Println(count)
You can also create your own Client for use with a different API or to use a different HTTP client:
client := pwnedpass.ClientV2{ HTTPClient: &http.Client{ Timeout: time.Second * 2, }, } count, err := client.Count("password") if err != nil { panic(err) } fmt.Println(count)
Index ¶
Constants ¶
View Source
const BaseURLV2 = "https://api.pwnedpasswords.com"
BaseURLV2 is the base URL for the V2 Pwned Passwords API.
Variables ¶
DefaultClient is the default client used for making requests to the PwnedPass API. It uses the V2 client with the https://api.pwnedpasswords.com base URL. It has a sane timeout of 5 seconds.
Functions ¶
This section is empty.
Types ¶
type ClientV2 ¶
ClientV2 is used for making requests to the PwnedPass V2 API.
Click to show internal directories.
Click to hide internal directories.