cidrs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(options *ListOptions) ([]string, error)

List will return list of CIDRs belonging to countries base on ListOptions provided

Types

type Country

type Country struct {
	ISOCode      string
	Subdivisions []string
}

Country

type ListOptions

type ListOptions struct {
	// NetworksReader if not provided DBPath will be used to initialize mmdb reader
	NetworksReader NetworksReader

	// DBPath file path to mmdb file
	DBPath string

	// List of countries and subdivisions to select
	Countries []Country

	// IPv4 set to return only this type
	IPv4 bool

	// IPv6 set to return only this type
	IPv6 bool
}

ListOptions

type NetworksReader

type NetworksReader interface {
	Next() bool
	Network(interface{}) (*net.IPNet, error)
	Err() error
}

NetworksReader allows to replace *maxminddb.Networks

Jump to

Keyboard shortcuts

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