Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct { IP net.IP Host string Raw []byte Output map[string][]string GatherTime time.Duration }
Result struct
func Query ¶
Query whois data for given url
Example ¶
ExampleQuery - An example of using the Query function
package main import ( "fmt" "strings" "github.com/xellio/whois" ) func main() { url := "http://github.com/xellio/whois" res, err := whois.Query(url) if err != nil { fmt.Println(err) return } fmt.Println(strings.Join(res.Output["Registrant City"], ",")) }
Output: San Francisco
func QueryHost ¶
QueryHost queries whois data for given host
Example ¶
ExampleQueryHost - An example of using the QueryHost function
package main import ( "fmt" "strings" "github.com/xellio/whois" ) func main() { host := "golang.org" res, err := whois.QueryHost(host) if err != nil { fmt.Println(err) return } fmt.Println(strings.Join(res.Output["Registrant Country"], ",")) }
Output: US
func QueryIP ¶
QueryIP queries whois data for given net.IP
Example ¶
ExampleQueryIp - An example of using the QueryIp function
package main import ( "fmt" "net" "strings" "github.com/xellio/whois" ) func main() { ip := net.ParseIP("8.8.8.8") res, err := whois.QueryIP(ip) if err != nil { fmt.Println(err) return } fmt.Println(strings.Join(res.Output["CIDR"], ",")) }
Output: 8.0.0.0/8,8.8.8.0/24
Click to show internal directories.
Click to hide internal directories.