改进cookie, session, ghttp关系,便于调用管理

This commit is contained in:
John
2017-12-30 23:49:55 +08:00
parent a2c5b4617b
commit 63694dc7e7
25 changed files with 387 additions and 135 deletions

View File

@ -56,6 +56,41 @@ func (this *InterfaceInterfaceMap) Get(key interface{}) (interface{}) {
return val
}
func (this *InterfaceInterfaceMap) GetInt(key interface{}) int {
if r := this.Get(key); r != nil {
return r.(int)
}
return 0
}
func (this *InterfaceInterfaceMap) GetUint (key interface{}) uint {
if r := this.Get(key); r != nil {
return r.(uint)
}
return 0
}
func (this *InterfaceInterfaceMap) GetFloat32 (key interface{}) float32 {
if r := this.Get(key); r != nil {
return r.(float32)
}
return 0
}
func (this *InterfaceInterfaceMap) GetFloat64 (key interface{}) float64 {
if r := this.Get(key); r != nil {
return r.(float64)
}
return 0
}
func (this *InterfaceInterfaceMap) GetString (key interface{}) string {
if r := this.Get(key); r != nil {
return r.(string)
}
return ""
}
// 删除键值对
func (this *InterfaceInterfaceMap) Remove(key interface{}) {
this.Lock()