升级easymap
This commit is contained in:
parent
d261c4eb1a
commit
ddb048c5c9
@ -33,4 +33,5 @@ type EasyMap interface {
|
||||
Del(key interface{})
|
||||
Exist(key interface{}) bool
|
||||
GetAll() map[interface{}]interface{}
|
||||
GetAllForMapKeyString() map[string]interface{}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
package easymap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/gopkg/convert"
|
||||
@ -271,3 +272,17 @@ func (n *normal) Unlock() {
|
||||
n.lock.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
// GetAllForMapKeyString ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:48 下午 2021/9/15
|
||||
func (n *normal) GetAllForMapKeyString() map[string]interface{} {
|
||||
fullData := n.GetAll()
|
||||
finalData := make(map[string]interface{})
|
||||
for k, v := range fullData {
|
||||
finalData[fmt.Sprintf("%v", k)] = v
|
||||
}
|
||||
return finalData
|
||||
}
|
||||
|
@ -8,6 +8,8 @@
|
||||
package easymap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/gopkg/util"
|
||||
)
|
||||
|
||||
@ -139,3 +141,17 @@ func (s *segment) GetAll() map[interface{}]interface{} {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// GetAllForMapKeyString ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:48 下午 2021/9/15
|
||||
func (s *segment) GetAllForMapKeyString() map[string]interface{} {
|
||||
fullData := s.GetAll()
|
||||
finalData := make(map[string]interface{})
|
||||
for k, v := range fullData {
|
||||
finalData[fmt.Sprintf("%v", k)] = v
|
||||
}
|
||||
return finalData
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
package easymap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/gopkg/convert"
|
||||
@ -218,3 +219,17 @@ func (s *syncMap) GetAll() map[interface{}]interface{} {
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
// GetAllForMapKeyString ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:48 下午 2021/9/15
|
||||
func (s *syncMap) GetAllForMapKeyString() map[string]interface{} {
|
||||
fullData := s.GetAll()
|
||||
finalData := make(map[string]interface{})
|
||||
for k, v := range fullData {
|
||||
finalData[fmt.Sprintf("%v", k)] = v
|
||||
}
|
||||
return finalData
|
||||
}
|
||||
|
@ -8,6 +8,8 @@
|
||||
package easymap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/gopkg/util"
|
||||
)
|
||||
|
||||
@ -120,3 +122,17 @@ func (s *segmentSync) GetAll() map[interface{}]interface{} {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// GetAllForMapKeyString ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:48 下午 2021/9/15
|
||||
func (s *segmentSync) GetAllForMapKeyString() map[string]interface{} {
|
||||
fullData := s.GetAll()
|
||||
finalData := make(map[string]interface{})
|
||||
for k, v := range fullData {
|
||||
finalData[fmt.Sprintf("%v", k)] = v
|
||||
}
|
||||
return finalData
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user