connfilter

package
v0.5.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilteringListener

type FilteringListener struct {
	Inner     net.Listener
	Blacklist IPBlacklist
	// contains filtered or unexported fields
}

func New

func New(inner net.Listener, blacklist IPBlacklist) *FilteringListener

func (*FilteringListener) Accept

func (l *FilteringListener) Accept() (net.Conn, error)

func (*FilteringListener) Addr

func (l *FilteringListener) Addr() net.Addr

func (*FilteringListener) Close

func (l *FilteringListener) Close() error

func (*FilteringListener) CloseBlocked

func (l *FilteringListener) CloseBlocked() int

func (*FilteringListener) CloseIP

func (l *FilteringListener) CloseIP(ip string) int

type HitResult

type HitResult struct {
	Blocked  bool
	Extended bool
	Reason   string
	IP       string
}

type IPBlacklist

type IPBlacklist interface {
	Check(ip net.IP, now time.Time) HitResult
	CheckAndRecordHit(ip net.IP, now time.Time) HitResult
}

Jump to

Keyboard shortcuts

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