utils

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 15 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()@:%_\+.~#?&//=]*)`
)

Variables

This section is empty.

Functions

func ByteToString

func ByteToString(b []byte) string

func DataMasking added in v0.0.15

func DataMasking(data string) string

DataMasking Data Masking

func Duration added in v0.0.19

func Duration(invocation time.Time, name string)

func ExtractUUID added in v0.0.15

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 added in v0.0.9

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 added in v0.0.16

func GetFDCount() uint64

func GetLocalIP4

func GetLocalIP4() (ip string)

GetLocalIP4 gets local ip address.

func GetSocketCount added in v0.0.16

func GetSocketCount() uint64

func IsIPv4

func IsIPv4(host string) bool

func IsUrl

func IsUrl(text string) bool

func Ping added in v0.0.17

func Ping(host string) bool

func Round added in v0.0.18

func Round(val float64, precision int) float64

func StringSliceDiff added in v0.0.8

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