Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IP ¶
type IP struct { Allows []netip.Prefix `json:"allows,omitempty"` Denies []netip.Prefix `json:"denies,omitempty"` }
func (IP) IsAllowed ¶
IsAllowed checks if an IP address is allowed according to Allows and Denies rules.
If the ip matches any of the Denies rules, IsAllowed returns false. If the ip matches any of the Allows rules (after checking all Denies rules), IsAllowed returns true.
Finally, if the ip matches no Allows or Denies rules, IsAllowed returns true only if no explicit Allows rules were defined.
func (IP) IsAllowedAddr ¶
IsAllowedAddr extracts the IP address from net.Addr and checks if it is allowed
func (IP) IsNotEmpty ¶
Click to show internal directories.
Click to hide internal directories.