Many useful golang tools
Version | Support Go |
---|---|
v1 | >= v1.16 |
v2 | >= v1.18 |
v3 | >= v1.19 |
v4 | >= v1.21 |
v5 | >= v1.23 |
go install github.com/Laisky/go-utils/v5/cmd/gutils@latest
Add $HOME/.go/bin
to your PATH.
# find and delete duplicate files/ similar images
gutils remove-dup examples/images --dry
# move files to hash-based hierach directories
gutils md5dir -i examples/md5dir/ --dry
# show x509 certificate details
gutils certinfo -r blog.laisky.com:443
gutils certinfo -f ./cert.pem
# encrypt by aes
gutils encrypt aes -i <file_path> -s <password>
# sign or verify by rsa
gutils rsa sign
gutils rsa verify
go get github.com/Laisky/go-utils/v5@latest
import (
gutils "github.com/Laisky/go-utils/v5"
)
Contains some useful tools in different directories:
settings
: move go github.com/Laisky/go-configcolor.go
: colorful codecompressor.go
: compress and extract dir/filesemail/
: SMTP email sdkencrypt/
: some tools for encrypt and decrypt, support AES, RSA, ECDSA, MD5, SHA128, SHA256configserver.go
: load configs from file or config-server
fs.go
: some tools to read, move, walk dir/fileshttp.go
: some tools to send http requestjwt/
: some tools to generate and parse JWTlog/
: enhanched zap loggermath.go
: some math tools to deal with int, roundnet.go
: some tools to deal with tcp/udprandom.go
: generate random string, intsort.go
: easier to sortsync.go
: some locks depends on atomicthrottle.go
: faster rate limitertime.go
: faster clock (if you do not enable vdso)utils
: some useful tools