mmdbinspect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 2

Documentation

Overview

Package mmdbinspect peeks at the contents of .mmdb files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregatedRecords

func AggregatedRecords(networks, databases []string, includeAliasedNetworks bool) (any, error)

AggregatedRecords returns the aggregated records for the networks and databases provided.

func OpenDB

func OpenDB(path string) (*maxminddb.Reader, error)

OpenDB returns a maxminddb.Reader.

func RecordToString

func RecordToString(record any) (string, error)

RecordToString converts an mmdb record into a JSON-formatted string.

func RecordsForNetwork

func RecordsForNetwork(reader maxminddb.Reader, includeAliasedNetworks bool, maybeNetwork string) (any, error)

RecordsForNetwork fetches mmdb records inside a given network. If an address is provided without a netmask a /32 will be inferred for v4 addresses and a /128 will be inferred for v6 addresses.

Types

type RecordForNetwork

type RecordForNetwork struct {
	Network string
	Record  any
}

RecordForNetwork holds a network and the corresponding record.

type RecordSet

type RecordSet struct {
	Database string
	Records  any
	Lookup   string
}

RecordSet holds the records for a lookup in a database.

Jump to

Keyboard shortcuts

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