Versions in this module Expand all Collapse all v1 v1.0.0 Oct 10, 2023 Changes in this version + type Policy struct + func NewPolicy(defaultAllow bool, rules []Rule) (*Policy, error) + func (h *Policy) Allowed(ip net.IP, port int) (bool, *Rule) + type Rule struct + func NewRule(ipnet *net.IPNet, ports []int, allow bool) (Rule, error) + func NewRuleByCIDR(prefix *string, ports []int, allow bool) (Rule, error) + func (ipr *Rule) Ports() []int + func (ipr *Rule) PortsString() string + func (ipr *Rule) RulePolicy() bool + func (ipr *Rule) String() string + func (ipr *Rule) StringCIDR() string + func (r *Rule) Validate() error