ipasn

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ipasn provides fast IP to ASN lookup using embedded binary data generated from MaxMind GeoLite2-ASN.

Default builds embed raw binary data. Build with -tags ipasn_gzip to embed gzipped data and decompress at init time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN struct {
	Number uint32 // e.g. 13335
	Org    string // e.g. "Cloudflare, Inc."
}

ASN represents an autonomous-system record.

func IPLookup

func IPLookup(ip netip.Addr) ASN

IPLookup returns the ASN for the given netip.Addr. Zero value if not found.

func Lookup

func Lookup(ip net.IP) ASN

Lookup returns the ASN for the given net.IP. Zero value if not found.

Directories

Path Synopsis
Command generate converts MaxMind GeoLite2-ASN.mmdb to ipasn binary format.
Command generate converts MaxMind GeoLite2-ASN.mmdb to ipasn binary format.

Jump to

Keyboard shortcuts

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