mod_trust_clientip

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ModTrustClientIP = "mod_trust_clientip"
)

Variables

This section is empty.

Functions

func AddrScopeListCheck

func AddrScopeListCheck(conf *AddrScopeFileList) error

func ConfModTrustClientIPCheck

func ConfModTrustClientIPCheck(cfg *ConfModTrustClientIP, confRoot string) error

func TrustIPConfCheck

func TrustIPConfCheck(conf *TrustIPConfFile) error

Types

type AddrScope

type AddrScope struct {
	Begin net.IP // start
	End   net.IP // end
}

type AddrScopeFile

type AddrScopeFile struct {
	Begin *string // start, e.g,. 119.75.215.0
	End   *string // end, e.g., 119.75.215.255
}

type AddrScopeFileList

type AddrScopeFileList []AddrScopeFile

type AddrScopeList

type AddrScopeList []AddrScope

type ConfModTrustClientIP

type ConfModTrustClientIP struct {
	Basic struct {
		DataPath string // path of config data (trust-ip)
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

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

ConfLoad loads config from config file.

func (*ConfModTrustClientIP) Check

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

type ModuleTrustClientIP

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

func NewModuleTrustClientIP

func NewModuleTrustClientIP() *ModuleTrustClientIP

func (*ModuleTrustClientIP) Init

func (*ModuleTrustClientIP) Name

func (m *ModuleTrustClientIP) Name() string

type ModuleTrustClientIPState

type ModuleTrustClientIPState struct {
	ConnTotal                *metrics.Counter // all connnetion checked
	ConnTrustClientip        *metrics.Counter // connection from trust addr
	ConnAddrInternal         *metrics.Counter // connection from internal
	ConnAddrInternalNotTrust *metrics.Counter // connection from internal and not trust
}

type SrcScopeMap

type SrcScopeMap map[string]*AddrScopeList // source => list of addr scope

type SrcScopeMapFile

type SrcScopeMapFile map[string]*AddrScopeFileList // source => list of addr scope

type TrustIPConf

type TrustIPConf struct {
	Version string // version of the config
	Config  SrcScopeMap
}

func TrustIPConfLoad

func TrustIPConfLoad(filename string) (TrustIPConf, error)

TrustIPConfLoad loads config of trust-ip from file

type TrustIPConfFile

type TrustIPConfFile struct {
	Version *string // version of the config
	Config  *SrcScopeMapFile
}

Jump to

Keyboard shortcuts

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