2022-05-14 16:07:21 +08:00
|
|
|
// Package easymap ...
|
|
|
|
//
|
|
|
|
// Description : easymap...
|
|
|
|
//
|
|
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
|
|
//
|
|
|
|
// Date : 2021-02-23 9:55 下午
|
|
|
|
package easymap
|
|
|
|
|
|
|
|
// EasyMap 约束各种数据接口的实现
|
|
|
|
//
|
|
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
|
|
//
|
|
|
|
// Date : 9:56 下午 2021/2/23
|
|
|
|
type EasyMap interface {
|
2023-12-24 22:10:47 +08:00
|
|
|
Get(key interface{}) (interface{}, bool)
|
2022-05-14 16:07:21 +08:00
|
|
|
GetWithReceiver(key interface{}, dest interface{}) error
|
|
|
|
GetUint(key interface{}) (uint, error)
|
|
|
|
GetUint8(key interface{}) (uint8, error)
|
|
|
|
GetUint16(key interface{}) (uint16, error)
|
|
|
|
GetUint32(key interface{}) (uint32, error)
|
|
|
|
GetUint64(key interface{}) (uint64, error)
|
|
|
|
GetInt(key interface{}) (int, error)
|
|
|
|
GetInt8(key interface{}) (int8, error)
|
|
|
|
GetInt16(key interface{}) (int16, error)
|
|
|
|
GetInt32(key interface{}) (int32, error)
|
|
|
|
GetInt64(key interface{}) (int64, error)
|
|
|
|
GetFloat32(key interface{}) (float32, error)
|
|
|
|
GetFloat64(key interface{}) (float64, error)
|
|
|
|
GetBool(key interface{}) (bool, error)
|
|
|
|
GetString(key interface{}) (string, error)
|
|
|
|
Set(key interface{}, value interface{})
|
|
|
|
Del(key interface{})
|
|
|
|
Exist(key interface{}) bool
|
2024-01-30 14:22:51 +08:00
|
|
|
Count() int
|
2022-05-14 16:07:21 +08:00
|
|
|
GetAll() map[interface{}]interface{}
|
|
|
|
GetAllForMapKeyString() map[string]interface{}
|
2023-03-07 17:34:02 +08:00
|
|
|
// Iterator 对数据的迭代
|
|
|
|
Iterator(IteratorFunc)
|
2023-08-10 15:48:46 +08:00
|
|
|
// ToStruct 转换成结构体
|
|
|
|
ToStruct(receiver interface{}) error
|
2023-08-15 20:46:43 +08:00
|
|
|
// ToString 转为字符串
|
|
|
|
ToString() string
|
2024-03-08 16:30:30 +08:00
|
|
|
// Filter 过滤数据
|
|
|
|
Filter(ignoreFieldList []string, rewriteFieldTable map[string]interface{}) map[string]interface{}
|
2022-05-14 16:07:21 +08:00
|
|
|
}
|