ipaccess

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

func NewPolicy

func NewPolicy(defaultAllow bool, rules []Rule) (*Policy, error)

func (*Policy) Allowed

func (h *Policy) Allowed(ip net.IP, port int) (bool, *Rule)

type Rule

type Rule struct {
	// contains filtered or unexported fields
}

func NewRule

func NewRule(ipnet *net.IPNet, ports []int, allow bool) (Rule, error)

func NewRuleByCIDR

func NewRuleByCIDR(prefix *string, ports []int, allow bool) (Rule, error)

func (*Rule) Ports

func (ipr *Rule) Ports() []int

func (*Rule) PortsString

func (ipr *Rule) PortsString() string

func (*Rule) RulePolicy

func (ipr *Rule) RulePolicy() bool

func (*Rule) String

func (ipr *Rule) String() string

func (*Rule) StringCIDR

func (ipr *Rule) StringCIDR() string

func (*Rule) Validate

func (r *Rule) Validate() error

Jump to

Keyboard shortcuts

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