Many useful golang tools
Install:
go get github.com/Laisky/go-utils
import (
"github.com/Laisky/go-utils"
)
There are small tools including:
Clock
: high performance lazy load clockSettings
: configuration manager that support yml and spring-cloud-config-serverCounter
: counter and rotate counterMail
: simply email sender- encrypt.go:
JWT
: simply JWT encrypt/decrypt functionsGeneratePasswordHash
: generate hashed passwordValidatePasswordHash
: validate hashed password
RequestJSON
: simply http client that send json request and unmarshal response by jsonLogger
: high performance structrued logger based by zapMath
: some simply math functionsRound
: get round of float
Throttle
: throttling to limit throughput- time: some useful time functions
UTCNow()
ParseTs2String
ParseTs2Time
- utils: some tool functions
GetFuncName
FallBack
RegexNamedSubMatch
FlattenMap
see more examples in tests or document