easymap/abstruct.go
2024-03-08 16:32:53 +08:00

47 lines
1.5 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 interface{}) (interface{}, bool)
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
Count() int
GetAll() map[interface{}]interface{}
GetAllForMapKeyString() map[string]interface{}
// Iterator 对数据的迭代
Iterator(IteratorFunc)
// ToStruct 转换成结构体
ToStruct(receiver interface{}) error
// ToString 转为字符串
ToString() string
// Filter 过滤数据
Filter(ignoreFieldList []string, rewriteFieldTable map[string]string) map[string]interface{}
}