whois

package
v0.0.0-...-360b248 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseWhoisDate

func ParseWhoisDate(date string) (rettime time.Time, err error)

ParseWhoisDate will take a date from a WHOIS response and turn it into a time object. If the conversion fails, an error will be returned.

Types

type Response

type Response struct {
	ObjectType                string
	DomainName                string
	Registrar                 string
	SponsoringRegistrarIANAID string
	WhoisServer               string
	ReferralURL               string
	NameServers               []string
	Statuses                  []string
	UpdatedDate               time.Time
	CreationDate              time.Time
	ExpirationDate            time.Time
	RegistrarURL              string
	TechContactName           string
	BillingContactName        string
	AdminContactName          string
	RegistrantContactName     string
	FullLookup                string
	DNSSECSigned              bool
}

Response is a data structre that contains the information that has been parsed from the WHOIS response.

func Query

func Query(domain string) (resp Response, errs []error)

Query takes a domain to lookup and then returns a response and a list of errors if any.

TODO: Switch the lookup to a map lookup rather than having to keep checking.

func (*Response) AddNameserver

func (r *Response) AddNameserver(name string)

AddNameserver will check if a name server exists in the list of name servers already and if not it will add it.

func (*Response) AddStatus

func (r *Response) AddStatus(status string)

AddStatus will check if a status exists in the list of statuses already and if not it will add it.

func (*Response) ParseFromWhois

func (r *Response) ParseFromWhois(data string, debug bool) (string, []error)

ParseFromWhois tries to extract WHOIS infomration from well formed WHOIS infomration into the data structure that is passed in. TODO: Split up function. TODO: switch the ifelse tree to a switch statment.

Jump to

Keyboard shortcuts

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