iptable

package
v0.0.0-...-fef60ef Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidIpv4Address = errors.New("invalid ip address")
	ErrInvalidIpv4Subnet  = errors.New("invalid ip subnet")
)

Validation errors.

Functions

This section is empty.

Types

type IPTable

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

IPTable Container for ip/subnet.

func NewIPTable

func NewIPTable() *IPTable

NewIPTable create new instance of IPTable.

func (*IPTable) Add

func (a *IPTable) Add(ipOrSubnet string) error

Add add ip or subnet.

func (*IPTable) Contains

func (a *IPTable) Contains(clientIP string) (bool, error)

Contains check contain IP in table.

func (*IPTable) GetAll

func (a *IPTable) GetAll() []string

GetAll get all registered ip or subnet.

func (*IPTable) Remove

func (a *IPTable) Remove(ipOrSubnet string)

Remove remove ip or subnet from table.

Jump to

Keyboard shortcuts

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