mod_tcp_keepalive

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModTcpKeepAlive = "mod_tcp_keepalive"
)

Variables

This section is empty.

Functions

func ConfModTcpKeepAliveCheck

func ConfModTcpKeepAliveCheck(cfg *ConfModTcpKeepAlive, confRoot string) error

func ProductRuleDataCheck

func ProductRuleDataCheck(conf ProductRuleData) error

func ProductRulesCheck

func ProductRulesCheck(conf ProductRules) error

func RulesCheck

func RulesCheck(conf KeepAliveRules) error

Types

type ConfModTcpKeepAlive

type ConfModTcpKeepAlive struct {
	Basic struct {
		DataPath string // path of product keepalive rule data
	}

	Log struct {
		OpenDebug bool // whether open debug
	}
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModTcpKeepAlive, error)

func (*ConfModTcpKeepAlive) Check

func (cfg *ConfModTcpKeepAlive) Check(confRoot string) error

type KeepAliveParam

type KeepAliveParam struct {
	Disable   bool // close the TCP-KeepAlive heartbeat message sending strategy
	KeepIdle  int  // period to send heartbeat message since there is no data transport in tcp connection
	KeepIntvl int  // period to send heartbeat message again when last message is not applied
	KeepCnt   int  // count to resend heartbeat message when last message is not applied
}

type KeepAliveRules

type KeepAliveRules map[string]KeepAliveParam

type KeepAliveTable

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

func NewKeepAliveTable

func NewKeepAliveTable() *KeepAliveTable

func (*KeepAliveTable) Search

func (t *KeepAliveTable) Search(product string) (KeepAliveRules, bool)

func (*KeepAliveTable) Update

func (t *KeepAliveTable) Update(data ProductRuleData)

type ModuleTcpKeepAlive

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

func NewModuleTcpKeepAlive

func NewModuleTcpKeepAlive() *ModuleTcpKeepAlive

func (*ModuleTcpKeepAlive) HandleAccept

func (m *ModuleTcpKeepAlive) HandleAccept(session *bfe_basic.Session) int

func (*ModuleTcpKeepAlive) Init

func (*ModuleTcpKeepAlive) Name

func (m *ModuleTcpKeepAlive) Name() string

type ModuleTcpKeepAliveState

type ModuleTcpKeepAliveState struct {
	ConnToSet                 *metrics.Counter // connection hit rule, to set or disable keeplaive
	ConnSetKeepIdle           *metrics.Counter // connection set keepalive idle
	ConnSetKeepIdleError      *metrics.Counter // connection set keepalive idle error
	ConnSetKeepIntvl          *metrics.Counter // connection set keepalive interval
	ConnSetKeepIntvlError     *metrics.Counter // connection set keepalive interval error
	ConnSetKeepCnt            *metrics.Counter // connection set keepalive retry count
	ConnSetKeepCntError       *metrics.Counter // connection set keepalive retry count error
	ConnDisableKeepAlive      *metrics.Counter // connection disable keepalive message
	ConnDisableKeepAliveError *metrics.Counter // connection disable keepalive error
	ConnConvertToTcpConnError *metrics.Counter // connection convert to TCPConn error
}

type ProductRuleConf

type ProductRuleConf struct {
	Version string
	Config  map[string]ProductRulesFile
}

type ProductRuleData

type ProductRuleData struct {
	Version string
	Config  ProductRules
}

func ConvertConf

func ConvertConf(c ProductRuleConf) (ProductRuleData, error)

func KeepAliveDataLoad

func KeepAliveDataLoad(filename string) (ProductRuleData, error)

type ProductRuleFile

type ProductRuleFile struct {
	VipConf        []string
	KeepAliveParam KeepAliveParam
}

type ProductRules

type ProductRules map[string]KeepAliveRules

type ProductRulesFile

type ProductRulesFile []ProductRuleFile

Jump to

Keyboard shortcuts

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