Documentation
¶
Overview ¶
Package util provides common utils.
Package util provides common utils.
Package util provides common utils.
Package util provides common utils.
Index ¶
- Constants
- func DeleteItemInList(target string, input []string) []string
- func EncodeMD5(value string) (string, error)
- func GenPass() string
- func GenPassWithLength(length int) string
- func GenUUID() string
- func GenerateRandString(l int) string
- func GetPhysicalNode(instanceName string) string
- func IsExistIntersection(s1 []string, s2 []string) bool
- func IsExistStrings(content string, ls []string) bool
- func IsNilInterface(i interface{}) bool
- func MapToList(input map[string]string) []string
- func MapToStr(input map[string]string) string
- func ParseRequest(req *http.Request, v interface{}) error
- func ParseResponse(resp *http.Response, v interface{}) error
- func RandBytes(size int) ([]byte, error)
- func Random(min, max int) int
- func RemoveRepeat(input []string) []string
- func Round(val float64, places int) float64
- func StringListToUintList(v []string) ([]uint, error)
- func TimeCost() func() time.Duration
- func ToMap(obj interface{}) map[string]interface{}
Constants ¶
View Source
const ( // DefaultLength is default length of generated password. DefaultLength = 8 ConstRoundFloat float64 = 0.50000000001 )
Variables ¶
This section is empty.
Functions ¶
func DeleteItemInList ¶
DeleteItemInList ...
func GenPassWithLength ¶
GenPassWithLength generate a random password with length.
func GenerateRandString ¶
GenerateRandString returns a random string with given length.
func GetPhysicalNode ¶
GetPhysicalNode get maxq@adca-arch-q-1.vm return adca-arch-q-1.vm
func IsExistIntersection ¶
IsExistIntersection 检查 s1 字符串列表是否在 s2 字符串列表中存在
func IsExistStrings ¶
IsExistStrings 检查 content 字符串是否在 ls 字符串列表中存在
func IsNilInterface ¶
func IsNilInterface(i interface{}) bool
IsNilInterface returns if an interface contains nil type or value. See https://dev.to/pauljlucas/go-tcha-when-nil--nil-hic for detailed information.
func ParseRequest ¶
func ParseResponse ¶
func StringListToUintList ¶
StringListToUintList 字符串列表转换成 uint 列表
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.