package
1.11.26
Repository: https://github.com/hedzr/cmdr-examples.git
Documentation: pkg.go.dev

# Functions

CloneMap do the clone on map[string]interface{}.
CopySlice do a generic copy from slice to new slice.
DecodeURIComponent reverts the working by EncodeURIComponent.
DiskUsage is for disk usage of path/disk.
EncodeURIComponent convert 'a b/c' -> 'a+b%2fc' origin := "äöüHel/lo world" encoded := EncodeURIComponent(origin) fmt.Println(encoded) s, _ := DecodeUriCompontent(encoded) fmt.Println(s).
HostToIP would parse string and transform host to ip addresses.
IsSlice test the type of 'v' if it is golang Slice.
IsV4 test ip if it's IPv4.
IsV6 test ip if it's IPv6.
LookupHostInfo scans the network adapters on local machine, finds all available IPs.
LookupHostInfoOld 依据配置文件的 server.rpc_address 尝试解释正确的rpc地址,通常是IPv4的.
MergeMap do the recursive merge on a map[string]interface{}.
MergeSlice do a merging on generic slice type.
Pollard 转换一个泛型对象中的全部 map[interface{}]interface{} 子对象为 map[string]interface{} 在转换完毕之后,新的返回对象将能够正确地被json编码: text = `age: 12 name: joe` obj, err := yaml.Unmarshal(text) b, err := json.Marshal(Pollard(obj)) 典型的用途在于将 golang 对象直接json输出时.
PollardArray converts 'in' to new return object A.
ThisHost 返回当前服务器的LAN ip,通过本机名进行反向解析.
ThisHostname 返回本机名.
URLEncodedSimple encodes a string like Javascript's encodeURIComponent() Example: Turns "My String" to "My%20String".

# Constants

DefaultPort is unused.

# Structs

DiskStatus provides the disk usages.

# Interfaces

Copier for deep-clone.

# Type aliases

EscapeError is an error type.