xipfilter

package
v0.0.0-...-796497b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPFilter

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

IPFilter ...

func New

func New(opts Options) *IPFilter

New ...

func (*IPFilter) AllowIP

func (f *IPFilter) AllowIP(ip string) bool

AllowIP ...

func (*IPFilter) Allowed

func (f *IPFilter) Allowed(ipstr string) bool

Allowed returns if a given IP can pass through the filter

func (*IPFilter) BlockIP

func (f *IPFilter) BlockIP(ip string) bool

BlockIP ..

func (*IPFilter) Blocked

func (f *IPFilter) Blocked(ip string) bool

Blocked returns if a given IP can NOT pass through the filter

func (*IPFilter) NetAllowed

func (f *IPFilter) NetAllowed(ip net.IP) bool

NetAllowed returns if a given net.IP can pass through the filter

func (*IPFilter) NetBlocked

func (f *IPFilter) NetBlocked(ip net.IP) bool

NetBlocked returns if a given net.IP can NOT pass through the filter

func (*IPFilter) ToggleIP

func (f *IPFilter) ToggleIP(str string, allowed bool) bool

ToggleIP ...

type Options

type Options struct {
	//explicity allowed IPs
	AllowedIPs []string
	//explicity blocked IPs
	BlockedIPs []string
	//block by default (defaults to allow)
	BlockByDefault bool
}

Jump to

Keyboard shortcuts

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