geoip

package
v0.0.0-...-d761558 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Overview

Package geoip implements functions for parsing and processing GeoIP resource files.

Index

Constants

View Source
const (
	TypeMaxmind Type = "MaxMind"
	TypeV2Ray        = "V2Ray"
	TypeMetaV0       = "Meta-geoip0"
	TypeSing         = "sing-geoip"
)

Variables

View Source
var ErrInvalidDatabase = errors.New("invalid GeoIP database")

Functions

This section is empty.

Types

type Database

type Database struct {
	SourceType Type
	MemoryType Type
	// contains filtered or unexported fields
}

func FromBytes

func FromBytes(data []byte) (db *Database, err error)

func FromFile

func FromFile(file string) (db *Database, err error)

func (Database) Close

func (db Database) Close() error

func (Database) LookupCode

func (db Database) LookupCode(ip net.IP) []string

func (Database) Reader

func (db Database) Reader() *maxminddb.Reader

type Type

type Type string

Jump to

Keyboard shortcuts

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