geo

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_MASKLEN = 32
View Source
const MIN_MASKLEN = 16

Variables

This section is empty.

Functions

func DecodeCountry

func DecodeCountry(country uint8) string

func DecodeISP

func DecodeISP(isp uint8) string

func DecodeRegion

func DecodeRegion(region uint8) string

func EncodeCountry

func EncodeCountry(country string) uint8

func EncodeISP

func EncodeISP(isp string) uint8

func EncodeRegion

func EncodeRegion(region string) uint8

Types

type GeoInfo

type GeoInfo struct {
	IPStart uint32
	IPEnd   uint32
	Country uint8
	Region  uint8
	ISP     uint8
}

type GeoTree

type GeoTree interface {
	Query(ip uint32) (uint8, uint8)
}

func NewNetmaskGeoTree

func NewNetmaskGeoTree() GeoTree

type IPRange

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

func (*IPRange) Lower

func (r *IPRange) Lower() (endpoint tree.Endpoint, closed bool)

func (*IPRange) Upper

func (r *IPRange) Upper() (endpoint tree.Endpoint, closed bool)

Jump to

Keyboard shortcuts

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