geoblock

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(fileName string, logger *slog.Logger) ([]string, error)

Types

type GeoData added in v0.2.0

type GeoData struct {
	ISOCode  string `maxminddb:"country_code" json:"iso_code"`
	Country  string `maxminddb:"country" json:"country"`
	ASN      string `maxminddb:"asn" json:"asn"`
	Provider string `maxminddb:"as_name" json:"provider"`
	Domain   string `maxminddb:"as_domain" json:"domain"`
}

type GeoIpLookup

type GeoIpLookup interface {
	Reopen() error
	GetAll(ipAddr string) (*GeoData, error)
	IsValid(ipAddr string) bool
}

func NewGeoIpLookup

func NewGeoIpLookup(path string, logger *slog.Logger) (GeoIpLookup, error)

type IpinfoUpdater added in v0.2.0

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

func NewIpinfoUpdaterCronJob added in v0.2.0

func NewIpinfoUpdaterCronJob(logger *slog.Logger, fileName string, geoIpLookup GeoIpLookup) *IpinfoUpdater

func (*IpinfoUpdater) Run added in v0.2.0

func (job *IpinfoUpdater) Run()

Jump to

Keyboard shortcuts

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