Documentation ¶
Index ¶
- Constants
- type Sign
- func (s *Sign) GenSign(params interface{}) string
- func (s *Sign) SetAppId(appId string) *Sign
- func (s *Sign) SetAppIdName(name string) *Sign
- func (s *Sign) SetIsSgin(isSign bool) *Sign
- func (s *Sign) SetKey(key string) *Sign
- func (s *Sign) SetKeyName(name string) *Sign
- func (s *Sign) SetType(_type int) *Sign
- func (s *Sign) ToLower(lower bool) *Sign
- func (s *Sign) VerifyMapSign(sign string, signmap map[string]string) bool
- func (s *Sign) VerifyParamsSign(params interface{}) bool
Constants ¶
View Source
const ( FROM_CONFIG = iota FROM_AUTHOR )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sign ¶
type Sign struct { Key string //签名KEY KeyName string //key名称,默认 AppKey AppId string //应用id AppIdName string //应用id名称,默认AppId,Server侧的规则是AppID IsSign bool //是否需要签名验证 Type int //0表示 Key和IsSign从配置文件读取,1表示调用者赋值 IsToLower bool //签名原字符串是否全部转化成小写字符 }
func (*Sign) VerifyMapSign ¶
和server保持一致的签名方案 body + appId+appkey + timestamp
Click to show internal directories.
Click to hide internal directories.