ripego

package module
v0.0.0-...-7e7e830 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: GPL-3.0 Imports: 10 Imported by: 0

README

ripego

Build Status

This package detects the coordination center for the IPv4 address and makes IP Whois lookup. Retrieve all informations about IP adress. Supported registries: ripe, arin, apnic, afrinic, lacnic

Install
$ go get github.com/c1982/ripego
Usage
package main

import (
	"fmt"
	"log"
	"ripego"
)

func main() {

	w, err := ripego.IPLookup("178.18.196.250")

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("Inetnum: " + w.Inetnum)
	fmt.Println("Desc: " + w.Descr)
}

//Output:
//Inetnum: 178.18.192.0 - 178.18.207.255
//Desc: Vargonen Teknoloji ve Bilisim Sanayi Ticaret Anonim Sirketi
Contact

aspsrc@gmail.com

Oğuzhan

Documentation

Index

Constants

View Source
const (
	// IANAWhois server
	IANAWhois = "whois.iana.org:43"
)

Variables

This section is empty.

Functions

func Query

func Query(ipaddr string) (result string, err error)

Query function

func Server

func Server(whois string) (whoisserver string, whoisorg string, err error)

Server function

Types

type Net

type Net struct {
	Name         string `xml:"name"`
	EndAddress   string `xml:"endAddress"`
	StartAddress string `xml:"startAddress"`
	OrgInfo      Org    `xml:"orgRef"`
	LastModified string `xml:"updateDate"`
	Created      string `xml:"registrationDate"`
}

type Org

type Org struct {
	Code string `xml:"handle,attr"`
	Name string `xml:"name,attr"`
}

type Whois

type Whois interface {
	Check(search string) (WhoisInfo, error)
	// contains filtered or unexported methods
}

Whois intercate containing the resulting infomration.

type WhoisData

type WhoisData struct {
	// contains filtered or unexported fields
}

WhoisData struct

type WhoisInfo

type WhoisInfo struct {
	Noc          string
	Inetnum      string
	Netname      string
	Descr        string
	Country      string
	Organization string
	AdminC       string
	TechC        string
	MntLower     string
	Status       string
	MntBy        string
	Created      string
	LastModified string
	Source       string
	MntRoutes    string
	Person       WhoisPerson
	Route        WhoisRoute
}

WhoisInfo struct with information on IP address range.

func AfrinicCheck

func AfrinicCheck(search string) (w WhoisInfo, err error)

AfrinicCheck function

func ApnicCheck

func ApnicCheck(search string) (w WhoisInfo, err error)

func ApnicCheck6

func ApnicCheck6(search string) (w WhoisInfo, err error)

func ArinCheck

func ArinCheck(search string) (w WhoisInfo, err error)

func IPLookup

func IPLookup(ipaddr string) (w WhoisInfo, err error)

IPLookup function that returns IP information at provider and returns information.

func IPv4Lookup

func IPv4Lookup(ipaddr string) (w WhoisInfo, err error)

IPv4Lookup function that returns IP information at provider and returns information.

func IPv6Lookup

func IPv6Lookup(ipaddr string) (w WhoisInfo, err error)

Search information about IPv6 IP address

func LacnicCheck

func LacnicCheck(search string) (w WhoisInfo, err error)

func RipeCheck

func RipeCheck(search string) (w WhoisInfo, err error)

func RipeCheck6

func RipeCheck6(search string) (w WhoisInfo, err error)

type WhoisPerson

type WhoisPerson struct {
	Name         string
	Address      string
	Phone        string
	AbuseMailbox string
	NicHdl       string
	MntBy        string
	Created      string
	LastModified string
	Source       string
}

WhoisPerson struct for Person information from provider.

type WhoisRoute

type WhoisRoute struct {
	Route        string
	Descr        string
	Origin       string
	MntBy        string
	Created      string
	LastModified string
	Source       string
}

WhoisRoute struct for Route and Network information from provider.

Jump to

Keyboard shortcuts

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