Documentation
¶
Index ¶
- func CheckMaxmindEnvironment() bool
- func CleanupInput(givenInput string) string
- func GetMaxmindDirFromConfig() string
- func GetMaxmindDirectory() string
- func IsFileInMaxmindDir(givenFile string) bool
- func OpenMaxmindDb(givenDbName string, givenDirectory ...string) (*geoip2.Reader, error)
- func OutputLookup(givenInput string, intel bool, resolve ...bool)
- func SimpleResolveDomain(givenInput string) (string, error)
- type IPInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMaxmindEnvironment ¶
func CheckMaxmindEnvironment() bool
CheckMaxmindEnvironment will check all neccesary files in the environment needed to function.
func CleanupInput ¶
CleanupInput does some light sanitization of the givenInput in the Lookup Func.
func GetMaxmindDirFromConfig ¶
func GetMaxmindDirFromConfig() string
GetMaxmindDirFromConfig will return the directory from the config if it exists otherwise
func GetMaxmindDirectory ¶
func GetMaxmindDirectory() string
GetMaxmindDirectory will return the expected directory for the maxmind db files according to OS
func IsFileInMaxmindDir ¶
IsFileInMaxmindDir will check if the givenFile is in the Maxmind dir and report back. If false will output to errs tream
func OpenMaxmindDb ¶
OpenMaxmindDb will open the givenDbName from the default or givenDirectory and return the Reader object
func OutputLookup ¶
OutputLookup executes and displays a single lookup to screen.
func SimpleResolveDomain ¶
SimpleResolveDomain will lookup a domain and return an IP if possible
Types ¶
type IPInfo ¶
type IPInfo struct { Input string // given input string for a lookup 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