net

package
v0.0.0-...-c387957 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPAddress

func GetIPAddress(r *http.Request) string

Get a clients real user IP Address

func IPContains

func IPContains(ipMatchers []*IPMatcher, ip string) bool

func IsIPInHetznerRange

func IsIPInHetznerRange(ip string) bool

Types

type IPMatcher

type IPMatcher struct {
	IP     net.IP
	SubNet *net.IPNet
}

func NewIPMatcher

func NewIPMatcher(ipStr string) (*IPMatcher, error)

func (IPMatcher) Match

func (m IPMatcher) Match(ipStr string) bool

type IPMatchers

type IPMatchers []*IPMatcher

func NewIPMatchers

func NewIPMatchers(ips []string) (list IPMatchers, err error)

Jump to

Keyboard shortcuts

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