README
¶
WhoisParser
WhoisParser is s simple Go module for domain whois information parsing.
Overview
This module parses the provided whois information and returns a readable data struct.
Verified Extensions
It is supposed to be working with all domain extensions, but verified extensions must works, because I have checked them one by one manually.
If there is any problems, please feel free to open a new issue.
Binary distributions
For binary distributions of whois information query and parsing, please download whois release tool.
Installation
go get github.com/likexian/whois-parser-go
Importing
import (
"github.com/likexian/whois-parser-go"
)
Documentation
Visit the docs on GoDoc
Example
result, err := whoisparser.Parse(whois_raw)
if err == nil {
// Print the domain status
fmt.Println(result.Domain.Status)
// Print the domain created date
fmt.Println(result.Domain.CreatedDate)
// Print the domain expiration date
fmt.Println(result.Domain.ExpirationDate)
// Print the registrar name
fmt.Println(result.Registrar.Name)
// Print the registrant name
fmt.Println(result.Registrant.Name)
// Print the registrant email address
fmt.Println(result.Registrant.Email)
}
Whois information query
Please refer to whois-go
License
Copyright 2014-2021 Li Kexian
Licensed under the Apache License 2.0
Donation
If this project is helpful, please share it with friends.
If you want to thank me, you can give me a cup of coffee.
Documentation
¶
Index ¶
- Variables
- func Author() string
- func ClearName(key string) string
- func FindKeyName(key string) string
- func FixDomainStatus(status []string) []string
- func FixNameServers(servers []string) []string
- func IsBlockedDomain(data string) bool
- func IsDnsSecEnabled(data string) bool
- func IsLimitExceeded(data string) bool
- func IsNotFound(data string) bool
- func IsPremiumDomain(data string) bool
- func Keys(m map[string]string) []string
- func License() string
- func Prepare(text, ext string) (string, bool)
- func Version() string
- type Contact
- type Domain
- type WhoisInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrDomainNotFound = errors.New("Domain is not found.") ErrDomainInvalidData = errors.New("Domain whois data invalid.") ErrDomainLimitExceed = errors.New("Domain query limit exceeded.") ErrPremiumDomain = errors.New("The domain is not registered, but available at a premium price.") ErrBlockedDomain = errors.New("The domain name is blocked due to a DPML brand name block.") )
Domain info error and replacer variables
Functions ¶
func FixDomainStatus ¶
FixDomainStatus returns fixed domain status
func FixNameServers ¶
FixNameServers returns fixed name servers
func IsBlockedDomain ¶ added in v1.14.6
IsBlockedDomain returns if the domain name is blocked due to a DPML brand name block
func IsDnsSecEnabled ¶ added in v1.14.0
IsDnsSecEnabled returns dnssec is enabled
func IsLimitExceeded ¶
IsLimitExceeded returns is query limit
func IsPremiumDomain ¶ added in v1.14.6
IsPremiumDomain returns if the domain name is available to register at a premium price
Types ¶
type Contact ¶ added in v1.9.0
type Contact struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Organization string `json:"organization,omitempty"` Street string `json:"street,omitempty"` City string `json:"city,omitempty"` Province string `json:"province,omitempty"` PostalCode string `json:"postal_code,omitempty"` Country string `json:"country,omitempty"` Phone string `json:"phone,omitempty"` PhoneExt string `json:"phone_ext,omitempty"` Fax string `json:"fax,omitempty"` FaxExt string `json:"fax_ext,omitempty"` Email string `json:"email,omitempty"` ReferralURL string `json:"referral_url,omitempty"` }
Contact storing domain contact info
type Domain ¶ added in v1.9.0
type Domain struct { ID string `json:"id,omitempty"` Domain string `json:"domain,omitempty"` Punycode string `json:"punycode,omitempty"` Name string `json:"name,omitempty"` Extension string `json:"extension,omitempty"` WhoisServer string `json:"whois_server,omitempty"` Status []string `json:"status,omitempty"` NameServers []string `json:"name_servers,omitempty"` DnsSec bool `json:"dnssec,omitempty"` CreatedDate string `json:"created_date,omitempty"` UpdatedDate string `json:"updated_date,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` }
Domain storing domain name info
type WhoisInfo ¶
type WhoisInfo struct { Domain *Domain `json:"domain,omitempty"` Registrar *Contact `json:"registrar,omitempty"` Registrant *Contact `json:"registrant,omitempty"` Administrative *Contact `json:"administrative,omitempty"` Technical *Contact `json:"technical,omitempty"` Billing *Contact `json:"billing,omitempty"` }
WhoisInfo storing domain whois info