myconv

package
v1.8.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectObj

func DirectObj(a any) any

去掉引用,返回对象本身

func IPV42Long

func IPV42Long(ip string) uint32

func Long2IPV4

func Long2IPV4(ipInt int64) string

func Map2Slice

func Map2Slice[K comparable, V any](mp map[K]V) (ks []K, vs []V)

func Obj2Stream added in v1.8.6

func Obj2Stream(obj any) ([]byte, error)

func StrToNum

func StrToNum[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64](str string) (ret T, err error)

func Stream2Obj added in v1.8.6

func Stream2Obj(stream []byte, obj any) error

func Struct2Map

func Struct2Map(a any) (map[string]any, error)

func ToAny

func ToAny[T any](i any) (T, error)

func ToBool

func ToBool(i any) (bool, error)

func ToNum

func ToNum[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64](i any) (T, error)

func ToStr

func ToStr(i any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL