Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAnalyzers ¶
DefaultAnalyzers returns the built-in analyzer set.
func DefaultModifiers ¶
DefaultModifiers returns the built-in modifier set.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App owns the Mellaris engine and ruleset lifecycle.
func (*App) ReloadRules ¶
ReloadRules reloads rules from the configured rules file.
type Config ¶
type Config struct {
IO IOConfig `mapstructure:"io" yaml:"io"`
Workers WorkersConfig `mapstructure:"workers" yaml:"workers"`
Ruleset RulesetConfig `mapstructure:"ruleset" yaml:"ruleset"`
}
Config defines IO, worker, and ruleset settings for the engine.
type ConfigError ¶
ConfigError indicates a configuration issue.
func (ConfigError) Error ¶
func (e ConfigError) Error() string
func (ConfigError) Unwrap ¶
func (e ConfigError) Unwrap() error
type IOConfig ¶
type IOConfig struct {
QueueSize uint32 `mapstructure:"queueSize" yaml:"queueSize"`
ReadBuffer int `mapstructure:"rcvBuf" yaml:"rcvBuf"`
WriteBuffer int `mapstructure:"sndBuf" yaml:"sndBuf"`
Local bool `mapstructure:"local" yaml:"local"`
RST bool `mapstructure:"rst" yaml:"rst"`
NumQueues int `mapstructure:"numQueues" yaml:"numQueues"`
MaxPacketLen uint32 `mapstructure:"maxPacketLen" yaml:"maxPacketLen"`
// PacketIO overrides NFQueue creation when set.
// When provided, App.Close will call PacketIO.Close.
PacketIO gfwio.PacketIO `mapstructure:"-" yaml:"-"`
}
IOConfig configures packet IO.
type Options ¶
type Options struct {
// RulesFile is a YAML rules file on disk. Mutually exclusive with Rules.
RulesFile string
// Rules provides inline expression rules. Mutually exclusive with RulesFile.
Rules []ruleset.ExprRule
// Analyzers and Modifiers default to built-ins when nil.
Analyzers []analyzer.Analyzer
Modifiers []modifier.Modifier
// EngineLogger and RulesetLogger default to no-op loggers when nil.
EngineLogger engine.Logger
RulesetLogger ruleset.Logger
}
Options configures rules, analyzers, modifiers, and logging.
type RulesetConfig ¶
type RulesetConfig struct {
GeoIp string `mapstructure:"geoip" yaml:"geoip"`
GeoSite string `mapstructure:"geosite" yaml:"geosite"`
}
RulesetConfig configures built-in rule helpers.
type WorkersConfig ¶
type WorkersConfig struct {
Count int `mapstructure:"count" yaml:"count"`
QueueSize int `mapstructure:"queueSize" yaml:"queueSize"`
TCPMaxBufferedPagesTotal int `mapstructure:"tcpMaxBufferedPagesTotal" yaml:"tcpMaxBufferedPagesTotal"`
TCPMaxBufferedPagesPerConn int `mapstructure:"tcpMaxBufferedPagesPerConn" yaml:"tcpMaxBufferedPagesPerConn"`
UDPMaxStreams int `mapstructure:"udpMaxStreams" yaml:"udpMaxStreams"`
OverflowPolicy engine.OverflowPolicy `mapstructure:"overflowPolicy" yaml:"overflowPolicy"`
AnalyzerSelectionMode engine.AnalyzerSelectionMode `mapstructure:"analyzerSelectionMode" yaml:"analyzerSelectionMode"`
}
WorkersConfig configures engine worker behavior.
Click to show internal directories.
Click to hide internal directories.