Documentation ¶
Index ¶
- Variables
- type BandwidthStat
- type BandwidthStatManager
- func (this *BandwidthStatManager) AddBandwidth(userId int64, serverId int64, peekBytes int64, totalBytes int64)
- func (this *BandwidthStatManager) AddTraffic(serverId int64, cachedBytes int64, countRequests int64, ...)
- func (this *BandwidthStatManager) Cancel()
- func (this *BandwidthStatManager) Inspect()
- func (this *BandwidthStatManager) Loop() error
- func (this *BandwidthStatManager) Map() map[int64]int64
- func (this *BandwidthStatManager) Save() error
- func (this *BandwidthStatManager) Start()
- type HTTPRequestStatManager
- func (this *HTTPRequestStatManager) AddFirewallRuleGroupId(serverId int64, firewallRuleGroupId int64, actions []*waf.ActionConfig)
- func (this *HTTPRequestStatManager) AddRemoteAddr(serverId int64, remoteAddr string, bytes int64, isAttack bool)
- func (this *HTTPRequestStatManager) AddUserAgent(serverId int64, userAgent string, ip string)
- func (this *HTTPRequestStatManager) Loop() error
- func (this *HTTPRequestStatManager) Start()
- func (this *HTTPRequestStatManager) Upload() error
- type StatItem
- type TrafficItem
- type TrafficStatManager
- type UserAgentParser
- type UserAgentParserResult
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BandwidthStat ¶ added in v0.4.9
type BandwidthStat struct { Day string `json:"day"` TimeAt string `json:"timeAt"` UserId int64 `json:"userId"` ServerId int64 `json:"serverId"` CurrentBytes int64 `json:"currentBytes"` CurrentTimestamp int64 `json:"currentTimestamp"` MaxBytes int64 `json:"maxBytes"` TotalBytes int64 `json:"totalBytes"` CachedBytes int64 `json:"cachedBytes"` AttackBytes int64 `json:"attackBytes"` CountRequests int64 `json:"countRequests"` CountCachedRequests int64 `json:"countCachedRequests"` CountAttackRequests int64 `json:"countAttackRequests"` }
type BandwidthStatManager ¶ added in v0.4.9
type BandwidthStatManager struct {
// contains filtered or unexported fields
}
BandwidthStatManager 服务带宽统计
func NewBandwidthStatManager ¶ added in v0.4.9
func NewBandwidthStatManager() *BandwidthStatManager
func (*BandwidthStatManager) AddBandwidth ¶ added in v1.0.0
func (this *BandwidthStatManager) AddBandwidth(userId int64, serverId int64, peekBytes int64, totalBytes int64)
AddBandwidth 添加带宽数据
func (*BandwidthStatManager) AddTraffic ¶ added in v1.0.0
func (this *BandwidthStatManager) AddTraffic(serverId int64, cachedBytes int64, countRequests int64, countCachedRequests int64, countAttacks int64, attackBytes int64)
AddTraffic 添加请求数据
func (*BandwidthStatManager) Cancel ¶ added in v1.0.0
func (this *BandwidthStatManager) Cancel()
Cancel 取消上传
func (*BandwidthStatManager) Inspect ¶ added in v0.4.9
func (this *BandwidthStatManager) Inspect()
func (*BandwidthStatManager) Loop ¶ added in v0.4.9
func (this *BandwidthStatManager) Loop() error
func (*BandwidthStatManager) Map ¶ added in v0.5.2
func (this *BandwidthStatManager) Map() map[int64]int64
func (*BandwidthStatManager) Save ¶ added in v1.0.0
func (this *BandwidthStatManager) Save() error
Save 保存到本地磁盘
func (*BandwidthStatManager) Start ¶ added in v0.4.9
func (this *BandwidthStatManager) Start()
type HTTPRequestStatManager ¶
type HTTPRequestStatManager struct {
// contains filtered or unexported fields
}
HTTPRequestStatManager HTTP请求相关的统计 这里的统计是一个辅助统计,注意不要因为统计而影响服务工作性能
func NewHTTPRequestStatManager ¶
func NewHTTPRequestStatManager() *HTTPRequestStatManager
NewHTTPRequestStatManager 获取新对象
func (*HTTPRequestStatManager) AddFirewallRuleGroupId ¶
func (this *HTTPRequestStatManager) AddFirewallRuleGroupId(serverId int64, firewallRuleGroupId int64, actions []*waf.ActionConfig)
AddFirewallRuleGroupId 添加防火墙拦截动作
func (*HTTPRequestStatManager) AddRemoteAddr ¶
func (this *HTTPRequestStatManager) AddRemoteAddr(serverId int64, remoteAddr string, bytes int64, isAttack bool)
AddRemoteAddr 添加客户端地址
func (*HTTPRequestStatManager) AddUserAgent ¶
func (this *HTTPRequestStatManager) AddUserAgent(serverId int64, userAgent string, ip string)
AddUserAgent 添加UserAgent
func (*HTTPRequestStatManager) Upload ¶
func (this *HTTPRequestStatManager) Upload() error
Upload 上传数据
type TrafficItem ¶
type TrafficItem struct { UserId int64 Bytes int64 CachedBytes int64 CountRequests int64 CountCachedRequests int64 CountAttackRequests int64 AttackBytes int64 PlanId int64 CheckingTrafficLimit bool }
func (*TrafficItem) Add ¶ added in v0.5.6
func (this *TrafficItem) Add(anotherItem *TrafficItem)
type TrafficStatManager ¶
type TrafficStatManager struct {
// contains filtered or unexported fields
}
TrafficStatManager 区域流量统计
func NewTrafficStatManager ¶
func NewTrafficStatManager() *TrafficStatManager
NewTrafficStatManager 获取新对象
type UserAgentParser ¶
type UserAgentParser struct {
// contains filtered or unexported fields
}
UserAgentParser UserAgent解析器
func NewUserAgentParser ¶
func NewUserAgentParser() *UserAgentParser
func (*UserAgentParser) Parse ¶
func (this *UserAgentParser) Parse(userAgent string) (result UserAgentParserResult)
Click to show internal directories.
Click to hide internal directories.