Documentation
¶
Index ¶
- Variables
- func FarSmaller(a, b int) bool
- func Init(path string, size int) error
- func IsSimilar(a, b int) bool
- type DB
- type IPStat
- type IPStatPool
- type JudgeLevel
- type Judgement
- type Stat
- func (*Stat) Descriptor() ([]byte, []int)deprecated
- func (x *Stat) GetPredictedType() UrlType
- func (x *Stat) GetSizeOfIPs() map[int64]bool
- func (x *Stat) GetStatPerVars() map[int64]*VarStat
- func (*Stat) ProtoMessage()
- func (x *Stat) ProtoReflect() protoreflect.Message
- func (x *Stat) Reset()
- func (x *Stat) String() string
- type StatInDb
- type StatWrapper
- type UrlType
- type VarStat
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Prefix_Url byte = 1 //SOH Prefix_Method byte = 2 //STX FeatureDBStatTable = []byte("_apicat_FeatureDBStatTable") )
View Source
var ( UrlType_name = map[int32]string{ 0: "UrlUnspecified", 1: "UrlNormal", 2: "UrlRestricted", 3: "UrlForSpecifiedUser", } UrlType_value = map[string]int32{ "UrlUnspecified": 0, "UrlNormal": 1, "UrlRestricted": 2, "UrlForSpecifiedUser": 3, } )
Enum value maps for UrlType.
View Source
var File_featuredb_stat_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Stat ¶
func (d *DB) Stat(pName, mName string) *StatWrapper
type IPStatPool ¶
type JudgeLevel ¶
type JudgeLevel byte
判断级别,因为特性库对于访问行为的判断基于现有访问判定模型进行 因此,每次访问都对错误有一个可能性的判定,可能性越高说明本次访问为错误访问的可能性越大 max 100
func (JudgeLevel) String ¶
func (j JudgeLevel) String() string
type Judgement ¶
type Judgement interface {
GetErrorType() etype.EntryError
}
type Stat ¶
type Stat struct { PredictedType UrlType `protobuf:"varint,1,opt,name=PredictedType,proto3,enum=featuredb.UrlType" json:"PredictedType,omitempty"` SizeOfIPs map[int64]bool `` /* 161-byte string literal not displayed */ StatPerVars map[int64]*VarStat `` /* 164-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Stat) Descriptor
deprecated
func (*Stat) GetPredictedType ¶
func (*Stat) GetSizeOfIPs ¶
func (*Stat) GetStatPerVars ¶
func (*Stat) ProtoMessage ¶
func (*Stat) ProtoMessage()
func (*Stat) ProtoReflect ¶
func (x *Stat) ProtoReflect() protoreflect.Message
type StatWrapper ¶
type StatWrapper struct {
// contains filtered or unexported fields
}
func (*StatWrapper) JudgeRequest ¶
func (d *StatWrapper) JudgeRequest(ip string, vars map[string]string) Judgement
func (*StatWrapper) Save ¶
func (d *StatWrapper) Save() error
type UrlType ¶
type UrlType int32
定义URL对应的数据接口的业务逻辑类型
func (UrlType) Descriptor ¶
func (UrlType) Descriptor() protoreflect.EnumDescriptor
func (UrlType) EnumDescriptor
deprecated
func (UrlType) Number ¶
func (x UrlType) Number() protoreflect.EnumNumber
func (UrlType) Type ¶
func (UrlType) Type() protoreflect.EnumType
type VarStat ¶
type VarStat struct { //参数只可能是限制型或者通用型或未判定 //限制型参数对应url的限制型和用户型 PredictedType UrlType `protobuf:"varint,1,opt,name=PredictedType,proto3,enum=featuredb.UrlType" json:"PredictedType,omitempty"` StatPerIPs map[int64]int64 `` /* 163-byte string literal not displayed */ // contains filtered or unexported fields }
func (*VarStat) Descriptor
deprecated
func (*VarStat) GetPredictedType ¶
func (*VarStat) GetStatPerIPs ¶
func (*VarStat) ProtoMessage ¶
func (*VarStat) ProtoMessage()
func (*VarStat) ProtoReflect ¶
func (x *VarStat) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.