connfilter

package
v0.0.0-...-f8dd16b Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package connfilter manages connection filter configurations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type                FilterType              `mapstructure:"type"`
	MatchDomain         string                  `mapstructure:"match_domain"`
	MatchDomainStrategy MatchDomainStrategyType `mapstructure:"match_domain_strategy"`
	MatchIP             string                  `mapstructure:"match_ip"`
}

Config represent one filter

type ConnFilter

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

ConnFilter class

func NewConnFilter

func NewConnFilter(config []Config, site string, monitorIPWithoutDomain bool) (*ConnFilter, []error)

NewConnFilter constructor

func (*ConnFilter) IsIncluded

func (f *ConnFilter) IsIncluded(domain string, ip netip.Addr) bool

IsIncluded return true if the matching domain and ip of a connection should be included

type Filter

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

Filter represent one filter

type FilterType

type FilterType string

FilterType is the filter type struct

const (
	// FilterTypeInclude const for include
	FilterTypeInclude FilterType = "include"
	// FilterTypeExclude const for exclude
	FilterTypeExclude FilterType = "exclude"
)

type MatchDomainStrategyType

type MatchDomainStrategyType string

MatchDomainStrategyType type for match domain strategy

const (
	// MatchDomainStrategyWildcard const for wildcard
	MatchDomainStrategyWildcard MatchDomainStrategyType = "wildcard"
	// MatchDomainStrategyRegex const for regex
	MatchDomainStrategyRegex MatchDomainStrategyType = "regex"
)

Jump to

Keyboard shortcuts

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