Versions in this module Expand all Collapse all v0 v0.9.0 Mar 16, 2023 Changes in this version + const FingerPrintUnit + const IntervalBetweenSlowRequest + var FeatureDBStatTable = []byte("_apicat_FeatureDBStatTable") + var File_featuredb_stat_proto protoreflect.FileDescriptor + var Prefix_Method byte = 2 + var Prefix_Url byte = 1 + var UrlType_name = map[int32]string + var UrlType_value = map[string]int32 + func FarSmaller(a, b int) bool + func Init(path string, size int) error + func InitByDb(db *bolt.DB, size int) + func IsSimilar(a, b int) bool + type DB struct + func (d *DB) IPToKey(ip string) int64 + func (d *DB) Stat(pName, mName string) *StatWrapper + func (d *DB) VarsToKey(vars map[string]string) int64 + type GlocalIpStat struct + IpMap map[int64]*Stat + func (*GlocalIpStat) Descriptor() ([]byte, []int) + func (*GlocalIpStat) ProtoMessage() + func (x *GlocalIpStat) GetIpMap() map[int64]*Stat + func (x *GlocalIpStat) ProtoReflect() protoreflect.Message + func (x *GlocalIpStat) Reset() + func (x *GlocalIpStat) String() string + type IPStatPool map[string]*Stat + type IpStatForOp struct + StatPerVars map[int64]int64 + func (*IpStatForOp) Descriptor() ([]byte, []int) + func (*IpStatForOp) ProtoMessage() + func (ip *IpStatForOp) GetFingerprint() int64 + func (x *IpStatForOp) GetStatPerVars() map[int64]int64 + func (x *IpStatForOp) ProtoReflect() protoreflect.Message + func (x *IpStatForOp) Reset() + func (x *IpStatForOp) String() string + type JudgeLevel byte + func (j JudgeLevel) String() string + type Judgement interface + GetErrorType func() etype.EntryError + type Stat struct + PredictedType UrlType + SizeOfIPs map[int64]int64 + StatOfSingleIP map[int64]*IpStatForOp + StatPerVars map[int64]*VarStat + func (*Stat) Descriptor() ([]byte, []int) + func (*Stat) ProtoMessage() + func (x *Stat) GetPredictedType() UrlType + func (x *Stat) GetSizeOfIPs() map[int64]int64 + func (x *Stat) GetStatOfSingleIP() map[int64]*IpStatForOp + func (x *Stat) GetStatPerVars() map[int64]*VarStat + func (x *Stat) ProtoReflect() protoreflect.Message + func (x *Stat) Reset() + func (x *Stat) String() string + type StatInDb interface + JudgeRequest func(ip string, at time.Time, parsInPath map[string]string) Judgement + func GetStatForAPI(path, mName string, def *openapi3.Operation) StatInDb + type StatWrapper struct + func (d *StatWrapper) IsStealingIP(fp int64) bool + func (d *StatWrapper) JudgeRequest(ip string, at time.Time, vars map[string]string) Judgement + func (d *StatWrapper) Save() error + type UrlType int32 + const UrlType_UrlForSpecifiedUser + const UrlType_UrlNormal + const UrlType_UrlRestricted + const UrlType_UrlUnspecified + func (UrlType) Descriptor() protoreflect.EnumDescriptor + func (UrlType) EnumDescriptor() ([]byte, []int) + func (UrlType) Type() protoreflect.EnumType + func (x UrlType) Enum() *UrlType + func (x UrlType) Number() protoreflect.EnumNumber + func (x UrlType) String() string + type VarStat struct + PredictedType UrlType + StatPerIPs map[int64]int64 + func (*VarStat) Descriptor() ([]byte, []int) + func (*VarStat) ProtoMessage() + func (x *VarStat) GetPredictedType() UrlType + func (x *VarStat) GetStatPerIPs() map[int64]int64 + func (x *VarStat) ProtoReflect() protoreflect.Message + func (x *VarStat) Reset() + func (x *VarStat) String() string v0.9.0-dev Feb 8, 2023