denyip

package
v0.0.0-...-c275005 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: 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
}

func NewChecker

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

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

func (*Checker) Contains

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

Contains checks if provided address is in the IPs.

func (*Checker) ContainsIP

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

ContainsIP checks if provided address is in the IPs.

func (*Checker) IsAuthorized

func (checker *Checker) IsAuthorized(addr string) error

IsAuthorized checks if provided request is authorized by the trusted IPs.

Jump to

Keyboard shortcuts

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