mod_trust_clientip

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

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 // connnection 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