Documentation ¶
Overview ¶
Package protocol
@author: xwc1125
Package protocol ¶
@author: xwc1125
Package protocol ¶
@author: xwc1125
Index ¶
- Constants
- Variables
- func ApiAuthProtocol(ctx contextx.Context, protocolConfig ProtocolConfig, ...)
- func ApiNormalProtocol(ctx contextx.Context, protocolConfig ProtocolConfig, ...)
- func AuthBySign(protocolConfig ProtocolConfig, requestMap *hashmap.HashMap, _key string) bool
- func GetAppInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.AppInfo
- func GetClientInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.ClientInfo
- func GetCoreDataInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.CoreDataInfo
- func GetDeviceInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.DeviceInfo
- func GetRequestMap(request *http.Request) *hashmap.HashMap
- func GetSdkInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.SdkInfo
- type LimitConfig
- type ProtocolConfig
- type RequestDataObj
Constants ¶
View Source
const (
KEY_REQUEST_OBJ = "KEY_REQUEST_OBJ"
)
Variables ¶
View Source
var ( DefaultProtocol = ProtocolConfig{ IsProtocol: true, FilterSignList: []string{"rsa", "sign"}, WhiteApiList: []string{}, Limit: LimitConfig{ AntiBrushFlag: false, InterTime: 10, }, } DefaultPrivateKey = `` /* 925-byte string literal not displayed */ )
Functions ¶
func ApiAuthProtocol ¶
func ApiAuthProtocol(ctx contextx.Context, protocolConfig ProtocolConfig, next func(obj *RequestDataObj))
ApiAuthProtocol 解析协议
func ApiNormalProtocol ¶
func ApiNormalProtocol(ctx contextx.Context, protocolConfig ProtocolConfig, next func(obj *RequestDataObj))
func AuthBySign ¶
func AuthBySign(protocolConfig ProtocolConfig, requestMap *hashmap.HashMap, _key string) bool
func GetAppInfo ¶
func GetAppInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.AppInfo
func GetClientInfo ¶
func GetClientInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.ClientInfo
func GetCoreDataInfo ¶
func GetCoreDataInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.CoreDataInfo
func GetDeviceInfo ¶
func GetDeviceInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.DeviceInfo
func GetRequestMap ¶
GetRequestMap 获取请求中的参数
func GetSdkInfo ¶
func GetSdkInfo(protocolConfig ProtocolConfig, aseKey, enStr string) *pmodel.SdkInfo
Types ¶
type LimitConfig ¶
type ProtocolConfig ¶
type ProtocolConfig struct { IsProtocol bool `json:"is_protocol" mapstructure:"is_protocol"` FilterSignList []string `json:"filter_sign_list" mapstructure:"filter_sign_list"` WhiteApiList []string `json:"white_api_list" mapstructure:"white_api_list"` Limit LimitConfig `json:"limit" mapstructure:"limit"` PrivateKey string `json:"private_key" mapstructure:"private_key"` }
type RequestDataObj ¶
type RequestDataObj struct { TcpInfo *tcputil.TcpInfo App *pmodel.AppInfo Sdk *pmodel.SdkInfo Phone *pmodel.PhoneInfo Device *pmodel.DeviceInfo Client *pmodel.ClientInfo Data *pmodel.CoreDataInfo Map *hashmap.HashMap OsType pmodel.ClientOsType AesKey string }
func (RequestDataObj) String ¶
func (data RequestDataObj) String() string
Click to show internal directories.
Click to hide internal directories.