Documentation ¶
Overview ¶
@Title @Description @Author @Date 11/6/20 9:42 PM
@Title @Description @Author @Date 11/6/20 12:05 PM
@Title @Description @Author @Date 11/6/20 9:43 PM
Index ¶
- Variables
- func ConvertHexToIp(hex string) string
- func ConvertIpToHex(ip string) string
- func FormatMacAddress(input string) string
- func GenerateUuid() string
- func HostsOfCidr(cidr string) ([]string, error)
- func IPString2Long(ip string) uint
- func IntegerStringToMac(macInt, separator string) []string
- func IsIpAddress(ip string) bool
- func IsValidIp(input string) bool
- func IsValidMac(input string) bool
- func Long2IPString(i uint) string
- func SplitAndTrim(str, delimiter string, characterMask ...string) []string
- func SplitWithoutTrim(str, delimiter string, characterMask ...string) []string
- func StringToFloat64(input string, defaultVal float64) float64
- func StringToInt(input string) int
- func StringToIntWithDefault(input string, defaultVal int) int
- func ToString(a interface{}) string
- func Trim(str string, characterMask ...string) string
- func TrimLeft(str string, characterMask ...string) string
- func TrimLeftStr(str string, cut string) string
- func TrimRight(str string, characterMask ...string) string
- func TrimRightStr(str string, cut string) string
- func TrimStr(str string, cut string) string
Constants ¶
This section is empty.
Variables ¶
var ( MacSeparators = []string{":", "-", " ", "."} MacRegexp = regexp.MustCompile(`^[a-fA-F0-9]{12}$`) )
Functions ¶
func ConvertHexToIp ¶ added in v0.1.4
func ConvertIpToHex ¶ added in v0.1.4
func FormatMacAddress ¶
FormatMacAddress @Description: format mac address to 12 bits @param input @return string
func GenerateUuid ¶ added in v0.1.4
func GenerateUuid() string
func HostsOfCidr ¶ added in v0.1.4
func IPString2Long ¶
func IntegerStringToMac ¶ added in v0.1.4
func IsValidMac ¶ added in v0.1.9
func SplitAndTrim ¶
SplitAndTrim splits string <str> by a string <delimiter> to an array, and calls Trim to every element of this array. It ignores the elements which are empty after Trim.
func SplitWithoutTrim ¶ added in v0.1.19
func StringToFloat64 ¶ added in v0.1.20
func StringToInt ¶
func StringToIntWithDefault ¶ added in v0.1.20
StringToIntWithDefault @Description: @param input @param defaultVal default value @return int
func Trim ¶
Trim strips whitespace (or other characters) from the beginning and end of a string. The optional parameter <characterMask> specifies the additional stripped characters.
func TrimLeftStr ¶
TrimLeftStr strips all of the given <cut> string from the beginning of a string. Note that it does not strips the whitespaces of its beginning.
func TrimRightStr ¶
TrimRightStr strips all of the given <cut> string from the end of a string. Note that it does not strips the whitespaces of its end.
Types ¶
This section is empty.