func GetWhois(ipAddressOrDomain string) Whois {
	var result Whois
	resultFile := path.Join(pathu.Tmp, "whois.json")
	resultJson := make(map[string]Whois)
	if resultTmpInfo, err := os.Stat(resultFile); err == nil {
		resultTmpModified := time.Since(resultTmpInfo.ModTime()).Seconds()
		if resultTmpModified > CACHE_TIMEOUT {
			fmt.Printf("Creating file %s... ", resultFile)
			if err := file.CreateFile(resultFile); err != nil {
				return result
			}
		} else {
			raw, err := ioutil.ReadFile(resultFile)
			if err != nil {
				return result
			}
			err = json.Unmarshal(raw, &resultJson)
			if err != nil {
				return result
			}
			if result, found := resultJson[ipAddressOrDomain]; found {
				return result
			}
		}
	}
	result, err := getOnline(ipAddressOrDomain)
	if err != nil {
	}  
	resultJson[ipAddressOrDomain] = result
	resultJsonMarsh, err := json.Marshal(resultJson)
	if err != nil {
	}
	err = ioutil.WriteFile(resultFile, resultJsonMarsh, 0644)
	if err != nil {
	}
	return result
}
GetWhois info of ip address or domain
package whois
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/cookiejar"
	"os"
	"path"
	"regexp"
	"strings"
	"time"
	"github.com/PuerkitoBio/goquery"
	"github.com/crazy-max/WindowsSpyBlocker/app/utils/config"
	"github.com/crazy-max/WindowsSpyBlocker/app/utils/file"
	"github.com/crazy-max/WindowsSpyBlocker/app/utils/netu"
	"github.com/crazy-max/WindowsSpyBlocker/app/utils/pathu"
)
const (
	HTTP_TIMEOUT  = 10
	CACHE_TIMEOUT = 172800
)
type Whois struct {
	Source  string
	IP      string
	Country string
	Org     string
}
type ipNfWhois struct {
	IP struct {
		IP          string  `json:"ip"`
		Asn         string  `json:"asn"`
		Netmask     int     `json:"netmask"`
		Hostname    string  `json:"hostname"`
		City        string  `json:"city"`
		PostCode    string  `json:"post_code"`
		Country     string  `json:"country"`
		CountryCode string  `json:"country_code"`
		Latitude    float32 `json:"latitude"`
		Longitude   float32 `json:"longitude"`
	} `json:"ip"`
}
type ipInfoWhois struct {
	Error struct {
		Title   string `json:"title"`
		Message string `json:"message"`
	} `json:"error"`
	IP       string `json:"ip"`
	Hostname string `json:"hostname"`
	City     string `json:"city"`
	Region   string `json:"region"`
	Country  string `json:"country"`
	Loc      string `json:"loc"`
	Org      string `json:"org"`
	Postal   string `json:"postal"`
}
type ipApiWhois struct {
	As          string  `json:"as"`
	City        string  `json:"city"`
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Isp         string  `json:"isp"`
	Lat         float32 `json:"lat"`
	Lon         float32 `json:"lon"`
	Org         string  `json:"org"`
	Query       string  `json:"query"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	Status      string  `json:"status"`
	Timezone    string  `json:"timezone"`
	Zip         string  `json:"zip"`
}