Documentation ¶
Index ¶
- func Clone(src interface{}) interface{}
- func DeepClone(src interface{}) interface{}
- func DeepCopy(dst, src interface{}) error
- func GenRandomStr(length int) string
- func GenSalt(length int) string
- func GetFreePort() (int, error)
- func GetLocalIp() string
- func GetLocalPriorityIp(priorityNetWork []string) string
- func GetTypeByContentType(contentType string) string
- func RemoteIp(req *http.Request) string
- func StructToMap(obj interface{}, tagName string) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
func Clone(src interface{}) interface{}
Clone 浅克隆,可以克隆任意数据类型,对指针类型子元素无法克隆 获取类型:如果类型是指针类型,需要使用Elem()获取对象实际类型 获取实际值:如果值是指针类型,需要使用Elem()获取实际数据 说白了,Elem()就是获取反射数据的实际类型和实际值
func GenRandomStr ¶
func GetFreePort ¶ added in v0.1.17
func GetLocalPriorityIp ¶
GetLocalPriorityIp 获取本机IP(根据规则优先选取IP)
func GetTypeByContentType ¶
func StructToMap ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.