ip

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker allows to check that addresses are in a trusted IPs.

func NewChecker

func NewChecker(trustedIPs []string) (*Checker, error)

NewChecker builds a new Checker given a list of CIDR-Strings to trusted IPs.

func (*Checker) Contains

func (ip *Checker) Contains(addr string) (bool, error)

Contains checks if provided address is in the trusted IPs.

func (*Checker) ContainsIP

func (ip *Checker) ContainsIP(addr net.IP) bool

ContainsIP checks if provided address is in the trusted IPs.

Jump to

Keyboard shortcuts

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