asn

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAsn

func FindAsn(addr netip.Addr) (asn string)

func Load

func Load(opts ...Option)

func SetFlags

func SetFlags(pflags *pflag.FlagSet, cfg *Config)

Types

type CacheEntry

type CacheEntry struct {
	Asn   string
	Range netipx.IPRange
}

type Config

type Config struct {
	Enabled       bool
	AsnUrl        string
	CountryUrl    string
	Directory     string
	CacheFilename string
}

type Option

type Option func(*Options)

func WithAsnUrl

func WithAsnUrl(x string) Option

func WithCacheFilename

func WithCacheFilename(x string) Option

func WithCountryUrl

func WithCountryUrl(x string) Option

func WithDirectory

func WithDirectory(x string) Option

func WithStorer

func WithStorer(x asnstorer) Option

type Options

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

Jump to

Keyboard shortcuts

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