whois_parser

package module
v0.0.0-...-ac70807 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

README

whois-parser.go

whois-parser-go is a simple Go module for whois info parser.

Overview

It will parse the provided whois information and return a readable data struct.

Works for most domain extensions most of the time.

Installation

go get github.com/easyconn/whois-parser-go

Importing

import (
    "github.com/easyconn/whois-parser-go"
)

Documentation

func Parser(whois string) (whois_info WhoisInfo, err error)

Example

result, err := whois_parser.Parser(whois_raw)
if err == nil {
    // Print the domain status
    fmt.Println(result.Registrar.DomainStatus)

    // Print the domain created date
    fmt.Println(result.Registrar.CreatedDate)

    // Print the domain expiration date
    fmt.Println(result.Registrar.ExpirationDate)

    // Print the registrant name
    fmt.Println(result.Registrant.Name)

    // Print the registrant email address
    fmt.Println(result.Registrant.Email)
}

LICENSE

Copyright 2014, Kexian Li

Apache License, Version 2.0

Whois info query in Go

Please refer to whois-go

About

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixNameServers

func FixNameServers(nservers string) string

func IsNotFound

func IsNotFound(data string) (result bool)

func ReadFile

func ReadFile(file string) (result string, err error)

func RemoveDuplicateField

func RemoveDuplicateField(data string) string

func StringInArray

func StringInArray(array []string, find string) bool

func TransferName

func TransferName(name string) string

func WriteFile

func WriteFile(file string, data string) (err error)

Types

type Registrant

type Registrant struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Organization string `json:"organization"`
	Street       string `json:"street"`
	StreetExt    string `json:"street_ext"`
	City         string `json:"city"`
	Province     string `json:"province"`
	PostalCode   string `json:"postal_code"`
	Country      string `json:"country"`
	Phone        string `json:"phone"`
	PhoneExt     string `json:"phone_ext"`
	Fax          string `json:"fax"`
	FaxExt       string `json:"fax_ext"`
	Email        string `json:"email"`
}

type Registrar

type Registrar struct {
	RegistrarID    string `json:"registrar_id"`
	RegistrarName  string `json:"registrar_name"`
	WhoisServer    string `json:"whois_server"`
	ReferralURL    string `json:"referral_url"`
	DomainId       string `json:"domain_id"`
	DomainName     string `json:"domain_name"`
	DomainStatus   string `json:"domain_status"`
	NameServers    string `json:"name_servers"`
	DomainDNSSEC   string `json:"domain_dnssec"`
	CreatedDate    string `json:"created_date"`
	UpdatedDate    string `json:"updated_date"`
	ExpirationDate string `json:"expiration_date"`
}

type WhoisInfo

type WhoisInfo struct {
	Registrar  Registrar  `json:"registrar"`
	Registrant Registrant `json:"registrant"`
	Admin      Registrant `json:"admin"`
	Tech       Registrant `json:"tech"`
	Bill       Registrant `json:"bill"`
}

func Parser

func Parser(whois string) (whois_info WhoisInfo, err error)

Jump to

Keyboard shortcuts

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