goPwned: github.com/mavjs/goPwned Index | Files

package gopwned

import "github.com/mavjs/goPwned"

Package gopwned implements the REST api of haveibeenpwned.com for easy querying

Index

Package Files

gopwned.go

Constants

const (
    Version        = "0.1"
    UserAgent      = "gopwned-api-client-" + Version
    MediaTypeV2    = "application/vnd.haveibeenpwned.v2+json"
    Endpoint       = "https://haveibeenpwned.com/api/v2/"
    PwnPwdEndpoint = "https://api.pwnedpasswords.com/range/"
)

func PwnedPasswords Uses

func PwnedPasswords(chars string) ([]byte, error)

type Breach Uses

type Breach struct {
    Name         string       `json:"Name,omitempty"`
    Title        string       `json:"Title,omitempty"`
    Domain       string       `json:"Domain,omitempty"`
    BreachDate   string       `json:"BreachDate,omitempty"`
    AddedDate    string       `json:"AddedDate,omitempty"`
    PwnCount     int          `json:"PwnCount,omitempty"`
    Description  string       `json:"Description,omitempty"`
    DataClasses  *DataClasses `json:"DataClasses,omitempty"`
    IsVerified   bool         `json:"IsVerified,omitempty"`
    IsFabricated bool         `json:"IsFabricated,omitempty"`
    IsSensitive  bool         `json:"IsSensitive,omitempty"`
    IsRetired    bool         `json:"IsRetired,omitempty"`
    IsSpamList   bool         `json:"IsSpamList,omitempty"`
    LogoType     string       `json:"LogoType,omitempty"`
}

func GetAllBreachedSites Uses

func GetAllBreachedSites(domain string) ([]*Breach, error)

func GetAllBreachesForAccount Uses

func GetAllBreachesForAccount(email, domain, truncateResponse string) ([]*Breach, error)

func GetBreachedSite Uses

func GetBreachedSite(site string) ([]*Breach, error)

type Client Uses

type Client struct {
    UserAgent string
    BaseURL   *url.URL
    PwnPwdURL *url.URL
    // contains filtered or unexported fields
}

func NewClient Uses

func NewClient(client *http.Client) *Client

func (*Client) GetAllBreachedSites Uses

func (c *Client) GetAllBreachedSites(domain string) ([]*Breach, error)

func (*Client) GetAllBreachesForAccount Uses

func (c *Client) GetAllBreachesForAccount(email, domain, truncateResponse string) ([]*Breach, error)

func (*Client) GetAllPastesForAccount Uses

func (c *Client) GetAllPastesForAccount(account string) ([]*Paste, error)

func (*Client) GetBreachedSite Uses

func (c *Client) GetBreachedSite(site string) ([]*Breach, error)

func (*Client) GetDataClasses Uses

func (c *Client) GetDataClasses() (*DataClasses, error)

func (*Client) PwnedPasswords Uses

func (c *Client) PwnedPasswords(chars string) ([]byte, error)

type DataClasses Uses

type DataClasses []string

func GetDataClasses Uses

func GetDataClasses() (*DataClasses, error)

type Paste Uses

type Paste struct {
    Source     string `json:"Source,omitempty"`
    ID         string `json:"Id,omitempty"`
    Title      string `json:"Title,omitempty"`
    Date       string `json:"Date,omitempty"`
    EmailCount int    `json:"EmailCount,omitempty"`
}

func GetAllPastesForAccount Uses

func GetAllPastesForAccount(account string) ([]*Paste, error)

Package gopwned imports 5 packages (graph). Updated 2019-11-16. Refresh now. Tools for package owners.