ddosconfigs

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: BSD-3-Clause Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPConfig

type IPConfig struct {
	IP          string `json:"ip"`
	Description string `json:"description"`
}

type PortConfig

type PortConfig struct {
	Port        int32  `json:"port"`
	Description string `json:"description"`
}

type ProtectionConfig

type ProtectionConfig struct {
	TCP *TCPConfig `yaml:"tcp" json:"tcp"`
}

func DefaultProtectionConfig

func DefaultProtectionConfig() *ProtectionConfig

func (*ProtectionConfig) Init

func (this *ProtectionConfig) Init() error

func (*ProtectionConfig) IsOn

func (this *ProtectionConfig) IsOn() bool

func (*ProtectionConfig) IsPriorEmpty

func (this *ProtectionConfig) IsPriorEmpty() bool

func (*ProtectionConfig) Merge

func (this *ProtectionConfig) Merge(childConfig *ProtectionConfig)

type TCPConfig

type TCPConfig struct {
	IsPrior             bool  `json:"isPrior"`
	IsOn                bool  `json:"isOn"`
	MaxConnections      int32 `json:"maxConnections"`
	MaxConnectionsPerIP int32 `json:"maxConnectionsPerIP"`

	// 分钟级速率
	NewConnectionsMinutelyRate             int32 `json:"newConnectionsRate"`             // 分钟
	NewConnectionsMinutelyRateBlockTimeout int32 `json:"newConnectionsRateBlockTimeout"` // 拦截时间

	// 秒级速率
	NewConnectionsSecondlyRate             int32 `json:"newConnectionsSecondlyRate"`
	NewConnectionsSecondlyRateBlockTimeout int32 `json:"newConnectionsSecondlyRateBlockTimeout"`

	AllowIPList []*IPConfig   `json:"allowIPList"`
	Ports       []*PortConfig `json:"ports"`
}

func (*TCPConfig) Init

func (this *TCPConfig) Init() error

Jump to

Keyboard shortcuts

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