ipcheck

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ipcheck provides a protocol-agnostic allow-list checker shared by the TCP and UDP ip_allow_list middlewares.

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. Check function copied from traefik codebase, thanks to them.

func NewChecker

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

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

func (*Checker) IsAuthorized

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

Jump to

Keyboard shortcuts

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