Documentation ¶
Index ¶
- func GetMapSlice[K comparable, T any](m Map[K], key K) ([]T, error)
- func GetMapValue[K comparable, V any](m Map[K], key K) (V, error)
- func RangeMapMap[K, K1 comparable, T any](m Map[K], key K, f func(K1, T) error) error
- func RangeMapSlice[K comparable, T any](m Map[K], key K, f func(T) error) error
- type Map
- func (m Map[K]) Contains(key K) bool
- func (m Map[K]) ConvertBool(key K) (bool, error)
- func (m Map[K]) ConvertComplex128(key K) (complex128, error)
- func (m Map[K]) ConvertFloat32(key K) (float32, error)
- func (m Map[K]) ConvertFloat64(key K) (float64, error)
- func (m Map[K]) ConvertInt(key K) (int, error)
- func (m Map[K]) ConvertInt64(key K) (int64, error)
- func (m Map[K]) ConvertMapSlice(key K) ([]Map[K], error)
- func (m Map[K]) ConvertString(key K) (string, error)
- func (m Map[K]) ConvertUint(key K) (uint, error)
- func (m Map[K]) ConvertUint64(key K) (uint64, error)
- func (m Map[K]) GetBestMatch(key K, f func(K, K) int) any
- func (m Map[K]) GetBool(key K) bool
- func (m Map[K]) GetComplex128(key K) complex128
- func (m Map[K]) GetFloat32(key K) float32
- func (m Map[K]) GetFloat64(key K) float64
- func (m Map[K]) GetInt(key K) int
- func (m Map[K]) GetInt64(key K) int64
- func (m Map[K]) GetMap(key K) (Map[K], error)
- func (m Map[K]) GetMapSlice(key K) []Map[K]
- func (m Map[K]) GetString(key K) string
- func (m Map[K]) GetUint(key K) uint
- func (m Map[K]) GetUint64(key K) uint64
- func (m Map[K]) ToString() string
- type MapCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMapSlice ¶
func GetMapSlice[K comparable, T any](m Map[K], key K) ([]T, error)
func GetMapValue ¶
func GetMapValue[K comparable, V any](m Map[K], key K) (V, error)
func RangeMapMap ¶
func RangeMapMap[K, K1 comparable, T any](m Map[K], key K, f func(K1, T) error) error
func RangeMapSlice ¶
func RangeMapSlice[K comparable, T any](m Map[K], key K, f func(T) error) error
Types ¶
type Map ¶
type Map[K comparable] map[K]any
func MakeMap ¶
func MakeMap[K comparable]() Map[K]
func (Map[K]) ConvertBool ¶ added in v0.2.4
尽可能转成bool
func (Map[K]) ConvertComplex128 ¶ added in v0.2.4
func (m Map[K]) ConvertComplex128(key K) (complex128, error)
尽可能转成complex
func (Map[K]) ConvertFloat32 ¶ added in v0.2.4
func (Map[K]) ConvertFloat64 ¶ added in v0.2.4
尽可能转成float
func (Map[K]) ConvertInt ¶ added in v0.2.4
func (Map[K]) ConvertInt64 ¶ added in v0.2.4
尽可能转成int
func (Map[K]) ConvertMapSlice ¶ added in v0.2.4
func (Map[K]) ConvertString ¶ added in v0.2.4
尽可能转成字符串
func (Map[K]) ConvertUint ¶ added in v0.2.4
func (Map[K]) ConvertUint64 ¶ added in v0.2.4
func (Map[K]) GetBestMatch ¶ added in v0.2.2
最佳匹配,如果f返回没有key大于0,则函数返回nil
func (Map[K]) GetComplex128 ¶
func (m Map[K]) GetComplex128(key K) complex128
func (Map[K]) GetFloat32 ¶
func (Map[K]) GetFloat64 ¶
func (Map[K]) GetMapSlice ¶
type MapCache ¶
type MapCache[K comparable] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.