dip/vendor/github.com/likexian/whois-go/README.md

81 lines
1.8 KiB
Markdown
Raw Normal View History

2020-05-24 18:42:01 +02:00
# Whois
2019-12-22 18:20:45 +01:00
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![GoDoc](https://godoc.org/github.com/likexian/whois-go?status.svg)](https://godoc.org/github.com/likexian/whois-go)
[![Build Status](https://travis-ci.org/likexian/whois-go.svg?branch=master)](https://travis-ci.org/likexian/whois-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/likexian/whois-go)](https://goreportcard.com/report/github.com/likexian/whois-go)
[![Code Cover](https://codecov.io/gh/likexian/whois-go/graph/badge.svg)](https://codecov.io/gh/likexian/whois-go)
2020-05-24 18:42:01 +02:00
Whois is a simple Go module for domain and ip whois information query.
2019-12-22 18:20:45 +01:00
## Overview
2020-05-24 18:42:01 +02:00
All of domain, ipv4 and ipv6 are support.
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
You can directly using the binary distributions whois, follow [whois release tool](cmd/whois).
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
Or you can do development by using this golang module as below.
2019-12-22 18:20:45 +01:00
## Installation
2020-05-24 18:42:01 +02:00
```shell
go get -u github.com/likexian/whois-go
```
2019-12-22 18:20:45 +01:00
## Importing
2020-05-24 18:42:01 +02:00
```go
import (
"github.com/likexian/whois-go"
)
```
2019-12-22 18:20:45 +01:00
## Documentation
Visit the docs on [GoDoc](https://godoc.org/github.com/likexian/whois-go)
## Example
### whois query for domain
```go
2020-05-24 18:42:01 +02:00
result, err := whois.Whois("likexian.com")
2019-12-22 18:20:45 +01:00
if err == nil {
fmt.Println(result)
}
```
2020-05-24 18:42:01 +02:00
### whois query for ipv6
```go
result, err := whois.Whois("2001:dc7::1")
if err == nil {
fmt.Println(result)
}
```
### whois query for ipv4
2019-12-22 18:20:45 +01:00
```go
result, err := whois.Whois("1.1.1.1")
if err == nil {
fmt.Println(result)
}
```
2020-05-24 18:42:01 +02:00
## Whois information parsing
2019-12-22 18:20:45 +01:00
Please refer to [whois-parser-go](https://github.com/likexian/whois-parser-go)
2020-05-24 18:42:01 +02:00
## License
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
Copyright 2014-2020 [Li Kexian](https://www.likexian.com/)
2019-12-22 18:20:45 +01:00
Licensed under the Apache License 2.0
2020-05-24 18:42:01 +02:00
## Donation
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
If this project is helpful, please share it with friends.
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
If you want to thank me, you can [give me a cup of coffee](https://www.likexian.com/donate/).