Documentation ¶
Index ¶
- Variables
- func DiffSlice(a interface{}, b interface{}) (interface{}, interface{})
- func KeyBy(list interface{}, fieldName string) interface{}
- func KeyByInt64[M any](list []*M, fieldName string) map[int64]*M
- func KeyByUint64[M any](list []*M, fieldName string) map[uint64]*M
- func MapKeysInt64(m interface{}) []int64
- func MapKeysString(m interface{}) []string
- func MapKeysUint64(m interface{}) []uint64
- func MapValues(m interface{}) interface{}
- func PluckInt(list interface{}, fieldName string) []int
- func PluckInt32(list interface{}, fieldName string) []int32
- func PluckInt64(list interface{}, fieldName string) []int64
- func PluckString(list interface{}, fieldName string) []string
- func PluckStringSlice(list interface{}, fieldName string) [][]string
- func PluckUint32(list interface{}, fileName string) []uint32
- func PluckUint64(list interface{}, fieldName string) []uint64
- func RemoveSlice(src interface{}, rm interface{}) interface{}
- func Slice2Map[M constraints.Ordered](list []M) map[M]bool
- func ToBool(val interface{}) bool
- func ToFloat32(val interface{}) float32
- func ToFloat64(val interface{}) float64
- func ToFloat64Slice(val interface{}) []float64
- func ToInt(val interface{}) int
- func ToInt16(val interface{}) int16
- func ToInt32(val interface{}) int32
- func ToInt64(val interface{}) int64
- func ToInt64Slice(val interface{}) []int64
- func ToInt8(val interface{}) int8
- func ToString(val interface{}) string
- func ToUint(val interface{}) uint
- func ToUint16(val interface{}) uint16
- func ToUint32(val interface{}) uint32
- func ToUint64(val interface{}) uint64
- func ToUint8(val interface{}) uint8
- type Map
- func (p *Map) Clone() *Map
- func (p *Map) DisableCut() *Map
- func (p *Map) EnableCut(seq string) *Map
- func (p *Map) Exists(key string) bool
- func (p *Map) Get(key string) (interface{}, error)
- func (p *Map) GetBool(key string) bool
- func (p *Map) GetBytes(key string) []byte
- func (p *Map) GetFloat64(key string) float64
- func (p *Map) GetInt(key string) int
- func (p *Map) GetInt32(key string) int32
- func (p *Map) GetInt64(key string) int64
- func (p *Map) GetInt64Slice(key string) []int64
- func (p *Map) GetMap(key string) *Map
- func (p *Map) GetSlice(key string) []interface{}
- func (p *Map) GetString(key string) string
- func (p *Map) GetStringSlice(key string) []string
- func (p *Map) GetUint16(key string) uint16
- func (p *Map) GetUint32(key string) uint32
- func (p *Map) GetUint32Slice(key string) []uint32
- func (p *Map) GetUint64(key string) uint64
- func (p *Map) GetUint64Slice(key string) []uint64
- func (p *Map) Range(f func(key, value interface{})) bool
- func (p *Map) Set(key string, value interface{})
- func (p *Map) ToMap() map[string]interface{}
- func (p *Map) ToSyncMap() *sync.Map
- type ValueType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
func DiffSlice ¶
func DiffSlice(a interface{}, b interface{}) (interface{}, interface{})
DiffSlice 传入两个slice 如果 a 或者 b 不为 slice 会 panic 如果 a 与 b 的元素类型不一致,也会 panic 返回的第一个参数为 a 比 b 多的,类型为 a 的类型 返回的第二个参数为 b 比 a 多的,类型为 b 的类型
func KeyByInt64 ¶
func KeyByUint64 ¶
func MapKeysInt64 ¶
func MapKeysInt64(m interface{}) []int64
func MapKeysString ¶
func MapKeysString(m interface{}) []string
func MapKeysUint64 ¶
func MapKeysUint64(m interface{}) []uint64
func PluckInt32 ¶
func PluckInt64 ¶
func PluckString ¶
func PluckStringSlice ¶
func PluckUint32 ¶
func PluckUint64 ¶
func RemoveSlice ¶
func RemoveSlice(src interface{}, rm interface{}) interface{}
RemoveSlice 传入两个slice 如果 src 或者 rm 不为 slice 会 panic 如果 src 与 rm 的元素类型不一致,也会 panic 返回的第一个参数为 src 中不在 rm 中的元素,数据类型与 src 一致
func Slice2Map ¶
func Slice2Map[M constraints.Ordered](list []M) map[M]bool
func ToFloat64Slice ¶
func ToFloat64Slice(val interface{}) []float64
func ToInt64Slice ¶
func ToInt64Slice(val interface{}) []int64
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func NewMapWithAny ¶
func NewMapWithJson ¶
func NewMapWithYaml ¶
func (*Map) DisableCut ¶
func (*Map) GetFloat64 ¶
func (*Map) GetInt64Slice ¶
func (*Map) GetStringSlice ¶
func (*Map) GetUint32Slice ¶
func (*Map) GetUint64Slice ¶
Click to show internal directories.
Click to hide internal directories.