asn

package
v0.0.0-...-421761b Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToInt

func ToInt(ip net.IP) int

Types

type ASNData

type ASNData struct {
	IPStart, IPEnd net.IP
	ASNNumber      string
	CountryCode    string
	ASName         string
}

type Query

type Query interface {
	FindASN(ip string) (ASNData, error)
}

func LoadLocal

func LoadLocal() Query

type RangeReader

type RangeReader struct {
	FromIPs []int
	ToIPs   []int
	ASNData []ASNData
}

func NewRangeReader

func NewRangeReader() *RangeReader

func (*RangeReader) FindASN

func (rr *RangeReader) FindASN(ip string) (ASNData, error)

func (*RangeReader) ReadAll

func (rangeReader *RangeReader) ReadAll(input *csv.Reader)

* Expected format of the CSV file IPStart\tIPEnd\tASNNumber\tCountryCode\tASName

type Reader

type Reader interface {
	ReadAll(input *csv.Reader) Query
}

Jump to

Keyboard shortcuts

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