ip

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	// Bingo check ip likes 23.19.0.1 or 2600:800:: wheter in filter
	Bingo(ip string) (ok bool, name string, err error)
}

Filter support operations of ip4/ip16 filter

func NewFilter

func NewFilter(zones ...*Zone) (Filter, error)

NewFilter return new instance filter no support dynamic change zones reason for performance; if zones changed, just new another filter.

type Zone

type Zone struct {
	Name string
	CIDR []string
}

Zone define cidr(s)

func MkZone

func MkZone(name, url string) (*Zone, error)

MkZone util to make zone name: zone name; url: likes http://ipverse.net/ipblocks/data/countries/us.zone

Jump to

Keyboard shortcuts

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