ipdetails

package module
v0.0.0-...-9ffe0d4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Go Report Card License

ipdetails

WIP wrapper on basic ip info

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenMaxmindDb

func OpenMaxmindDb(givenDbName string, givenDirectory ...string) (*geoip2.Reader, error)

OpenMaxmindDb will open the givenDbName from the default or givenDirectory and return the Reader object

func OutputLookup

func OutputLookup(givenInput string, intel bool)

Types

type IPInfo

type IPInfo struct {
	IPStr       string // given IP String or input
	IP          net.IP // net.IP representation of the IP string or input
	ASNum       int    // Autonomous system number as int
	ASNumStr    string // Autonomous system number as string prefixed with "AS"
	ASName      string // Autonomous system name
	CountryCode string // ISO Country Code
	CountryName string // Country name
}

IPInfo is the struct of enriched geoip info

func Lookup

func Lookup(givenIpStr string) (IPInfo, error)

Lookup will look up the givenIpStr string and return a fully parsed IPInfo struct

Directories

Path Synopsis
app
cmd

Jump to

Keyboard shortcuts

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