ipfilter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 5 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 {
	RawFilter ipfilter.IPFilter // IPAddr is target IP to apply the filter with a policy
	// contains filtered or unexported fields
}

IPFilter is an (experimental) struct represents IP filter

func NewIPFilter

func NewIPFilter(policy bool, ips []string) *IPFilter

NewIPFilter returns a new IPFilter instance with specified IP addresses. This

func (*IPFilter) Authorize added in v0.6.0

func (ipf *IPFilter) Authorize(handle http.HandlerFunc, _ ...string) http.HandlerFunc

Authorize is one of the AuthWrapper which enables IP filtering to allow/deny specific network address.

func (*IPFilter) RouterAuthorize added in v0.6.0

func (ipf *IPFilter) RouterAuthorize(handle httprouter.Handle, _ ...string) httprouter.Handle

RouterAuthorize is one of the RouterAuthWrapper which enables IP filtering to allow/deny specific network address.

Jump to

Keyboard shortcuts

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