geoipx

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN struct {
	Number uint   `json:"number"`
	Org    string `json:"org"`
}

type Country

type Country struct {
	Name    string `json:"name"`
	ISOCode string `json:"isoCode"`
}

type DB

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

func New

func New(log *slog.Logger, city, asn string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Lookup

func (db *DB) Lookup(ip netip.Addr) (*Meta, error)

func (*DB) Stop

func (db *DB) Stop()

func (*DB) Watch

func (db *DB) Watch(ctx context.Context) error

type Meta

type Meta struct {
	City         string   `json:"city"`
	Country      Country  `json:"country"`
	Subdivisions []string `json:"subdivisions"`
	ASN          ASN      `json:"asn"`
}

Jump to

Keyboard shortcuts

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