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 {
|
2024-11-01 16:25:29 +08:00
|
|
|
Get(key any) (any, bool)
|
|
|
|
GetWithReceiver(key any, dest any) error
|
|
|
|
GetUint(key any) (uint, error)
|
|
|
|
GetUint8(key any) (uint8, error)
|
|
|
|
GetUint16(key any) (uint16, error)
|
|
|
|
GetUint32(key any) (uint32, error)
|
|
|
|
GetUint64(key any) (uint64, error)
|
|
|
|
GetInt(key any) (int, error)
|
|
|
|
GetInt8(key any) (int8, error)
|
|
|
|
GetInt16(key any) (int16, error)
|
|
|
|
GetInt32(key any) (int32, error)
|
|
|
|
GetInt64(key any) (int64, error)
|
|
|
|
GetFloat32(key any) (float32, error)
|
|
|
|
GetFloat64(key any) (float64, error)
|
|
|
|
GetBool(key any) (bool, error)
|
|
|
|
GetString(key any) (string, error)
|
|
|
|
Set(key any, value any)
|
|
|
|
Del(key any)
|
|
|
|
Exist(key any) bool
|
2024-01-30 14:22:51 +08:00
|
|
|
Count() int
|
2024-11-01 16:25:29 +08:00
|
|
|
GetAll() map[any]any
|
|
|
|
GetAllForMapKeyString() map[string]any
|
2024-03-11 11:08:08 +08:00
|
|
|
// Merge 合并数据
|
|
|
|
Merge(mergeData ...EasyMap)
|
|
|
|
// MergeWithReceiver 合并数据并转换
|
2024-11-01 16:25:29 +08:00
|
|
|
MergeWithReceiver(receiver any, mergeData ...EasyMap) error
|
2023-03-07 17:34:02 +08:00
|
|
|
// Iterator 对数据的迭代
|
|
|
|
Iterator(IteratorFunc)
|
2023-08-10 15:48:46 +08:00
|
|
|
// ToStruct 转换成结构体
|
2024-11-01 16:25:29 +08:00
|
|
|
ToStruct(receiver any) error
|
2023-08-15 20:46:43 +08:00
|
|
|
// ToString 转为字符串
|
|
|
|
ToString() string
|
2024-03-08 16:30:30 +08:00
|
|
|
// Filter 过滤数据
|
2024-11-01 16:25:29 +08:00
|
|
|
Filter(ignoreFieldList []string, rewriteFieldTable map[string]string) map[string]any
|
2022-05-14 16:07:21 +08:00
|
|
|
}
|