pwn

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 9 Imported by: 1

README

Have I Been Pwned

Go library for interacting with HaveIBeenPwned.

Implemented:

  • Breaches
  • Pastes
  • Passwords

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrEmptyPassword

func IsErrEmptyPassword(err error) bool

IsErrEmptyPassword checks if an error is ErrEmptyPassword

func WithContext added in v0.0.2

func WithContext(ctx context.Context) func(pwnClient *Client)

WithContext will set the context.Context of a Client

func WithHTTP added in v0.0.2

func WithHTTP(httpClient *http.Client) func(pwnClient *Client)

WithHTTP will set the http.Client of a Client

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a HaveIBeenPwned client

func New

func New(options ...ClientOption) *Client

New returns a new HaveIBeenPwned Client

func (*Client) CheckPassword

func (c *Client) CheckPassword(pw string, padding bool) (int, error)

CheckPassword returns the number of times a password has been compromised Adding padding will make requests more secure, however is also slower because artificial responses will be added to the response For more information, see https://www.troyhunt.com/enhancing-pwned-passwords-privacy-with-padding/

type ClientOption added in v0.0.2

type ClientOption func(*Client)

ClientOption is a way to modify a new Client

type ErrEmptyPassword

type ErrEmptyPassword struct{}

ErrEmptyPassword is an empty password error

func (ErrEmptyPassword) Error

func (e ErrEmptyPassword) Error() string

Error fulfills the error interface

Directories

Path Synopsis
cmd
pwn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL