filter

package
v0.0.1-test9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package filter provides connection filtering by domain and IP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

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

Filter manages domain and IP allowlists.

func New

func New() *Filter

New creates a new Filter.

func (*Filter) AddDomains

func (f *Filter) AddDomains(domains []string)

AddDomains adds domains to the allowlist.

func (*Filter) AddIPs

func (f *Filter) AddIPs(ips []string)

AddIPs adds IPs or CIDRs to the allowlist.

func (*Filter) AllowHost

func (f *Filter) AllowHost(host string) bool

AllowHost checks if a host (domain or IP) is allowed.

func (*Filter) IsEnabled

func (f *Filter) IsEnabled() bool

IsEnabled returns whether the filter is enabled.

func (*Filter) RemoveDomain

func (f *Filter) RemoveDomain(domain string)

RemoveDomain removes a domain from the allowlist.

func (*Filter) SetAllowlist

func (f *Filter) SetAllowlist(domains []string, ips []string)

SetAllowlist sets the domain and IP allowlists.

func (*Filter) SetEnabled

func (f *Filter) SetEnabled(enabled bool)

SetEnabled enables or disables the filter.

Jump to

Keyboard shortcuts

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