Documentation ¶
Index ¶
- func ClearNestedStruct(s interface{}) interface{}
- 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 ReadConfig(configStr string, out interface{})
- func RemoteIp(req *http.Request) string
- func SplitStringArray(arr []string, length int) [][]string
- func StructToMap(obj interface{}, tagName string) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearNestedStruct ¶ added in v0.3.11
func ClearNestedStruct(s interface{}) interface{}
func Clone ¶
func Clone(src interface{}) interface{}
Clone 浅克隆,可以克隆任意数据类型,对指针类型子元素无法克隆 获取类型:如果类型是指针类型,需要使用Elem()获取对象实际类型 获取实际值:如果值是指针类型,需要使用Elem()获取实际数据 说白了,Elem()就是获取反射数据的实际类型和实际值
func GetLocalPriorityIp ¶
GetLocalPriorityIp 获取本机IP(根据规则优先选取IP)
func GetTypeByContentType ¶
GetTypeByContentType 根据文件类型获取文件后缀
func ReadConfig ¶ added in v0.3.3
func ReadConfig(configStr string, out interface{})
ReadConfig 读取配置文件.将配置文件字符串加载至实例中
func SplitStringArray ¶ added in v0.4.2
func StructToMap ¶
StructToMap 结构体转Map
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.