51 lines
1.4 KiB
Go
51 lines
1.4 KiB
Go
// 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 {
|
|
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
|
|
Count() int
|
|
GetAll() map[any]any
|
|
GetAllForMapKeyString() map[string]any
|
|
// Merge 合并数据
|
|
Merge(mergeData ...EasyMap)
|
|
// MergeWithReceiver 合并数据并转换
|
|
MergeWithReceiver(receiver any, mergeData ...EasyMap) error
|
|
// Iterator 对数据的迭代
|
|
Iterator(IteratorFunc)
|
|
// ToStruct 转换成结构体
|
|
ToStruct(receiver any) error
|
|
// ToString 转为字符串
|
|
ToString() string
|
|
// Filter 过滤数据
|
|
Filter(ignoreFieldList []string, rewriteFieldTable map[string]string) map[string]any
|
|
}
|