util

package
v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UrlRegex   = `https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)`
	EmailRegex = `[a-z0-9_\.-]+\@[\da-z\.-]+\.[a-z\.]{2,6}`
)

Variables

This section is empty.

Functions

func ByteToString

func ByteToString(b []byte) string

func DataMasking

func DataMasking(data string) string

DataMasking Data Masking

func Duration

func Duration(invocation time.Time, name string)

func ExtractUUID

func ExtractUUID(path string) string

ExtractUUID extract path

func GeneratePassword

func GeneratePassword(length int, containChars string) string

GeneratePassword containChars : "lowercase|uppercase|numbers|hyphen|underline|space|specials|brackets|no_similar"

func GenerateUUID

func GenerateUUID() (string, error)

GenerateUUID generates a random ID for a message

func GetAvailablePort

func GetAvailablePort() int

GetAvailablePort returns a port at random

func GetFDCount

func GetFDCount() uint64

func GetLocalIP4

func GetLocalIP4() (ip string)

GetLocalIP4 gets local ip address.

func GetSocketCount

func GetSocketCount() uint64

func IsIPv4

func IsIPv4(host string) bool

func IsUrl

func IsUrl(text string) bool

func Ping

func Ping(_ string) bool

func Round

func Round(val float64, precision int) float64

func SHA1

func SHA1(url string) string

func StringSliceDiff

func StringSliceDiff(s1, s2 []string) []string

func StringToByte

func StringToByte(s string) (b []byte)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL