Versions in this module Expand all Collapse all v0 v0.1.0 Oct 7, 2023 Changes in this version + type Banning struct + CheckThreshold int32 + Enabled bool + IPSet string + InvalidPercent float32 + MalformedLimit int32 + Timeout int64 + type Config struct + Banning Banning + Limits Limits + RefreshInterval string + ResetInterval string + Workers int + type Limits struct + Enabled bool + Grace string + Limit int32 + LimitJump int32 + type PolicyServer struct + func Start(cfg *Config, storage *storage.RedisClient) *PolicyServer + func (s *PolicyServer) ApplyLimitPolicy(ip string) bool + func (s *PolicyServer) ApplyLoginPolicy(addy, ip string) bool + func (s *PolicyServer) ApplyMalformedPolicy(ip string) bool + func (s *PolicyServer) ApplySharePolicy(ip string, validShare bool) bool + func (s *PolicyServer) BanClient(ip string) + func (s *PolicyServer) Get(ip string) *Stats + func (s *PolicyServer) InBlackList(addy string) bool + func (s *PolicyServer) InWhiteList(ip string) bool + func (s *PolicyServer) IsBanned(ip string) bool + func (s *PolicyServer) NewStats() *Stats + type Stats struct + Banned int32 + BannedAt int64 + ConnLimit int32 + InvalidShares int32 + LastBeat int64 + Malformed int32 + ValidShares int32