privnet

package
v0.0.0-...-8b501b0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector checks whether a host name resolves to a private network address.

func NewDetector

func NewDetector() (*Detector, error)

NewDetector returns a new Detector instance which is initialized with the default list of IPv4/IPv6 CIDR blocks that correspond to private networks according to RFC1918.

func NewDetectorFromCIDRs

func NewDetectorFromCIDRs(privateNetworkCIDRs ...string) (*Detector, error)

NewDetectorFromCIDRs returns a new Detector instance which is initialized with the specified list of privateNetworkCIDRs.

func (*Detector) IsPrivate

func (d *Detector) IsPrivate(address string) (bool, error)

IsPrivate returns true if address resolves to a private network.

Jump to

Keyboard shortcuts

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