Categorygithub.com/Laisky/go-utils
5.0.0
Repository: https://github.com/laisky/go-utils.git
Documentation: pkg.go.dev

# README

Go-Utils

Many useful golang tools

VersionSupport Go
v1>= v1.16
v2>= v1.18
v3>= v1.19
v4>= v1.21
v5>= v1.23

License: MIT Commitizen friendly Go Report Card GoDoc Build Status codecov

Use as command-line executable binary

Install

go install github.com/Laisky/go-utils/v5/cmd/gutils@latest

Add $HOME/.go/bin to your PATH.

Usage

# 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

Use as SDK

Install

go get github.com/Laisky/go-utils/v5@latest

Usage

import (
    gutils "github.com/Laisky/go-utils/v5"
)

Modules

Contains some useful tools in different directories:

  • settings: move go github.com/Laisky/go-config
  • color.go: colorful code
  • compressor.go: compress and extract dir/files
  • email/: SMTP email sdk
  • encrypt/: some tools for encrypt and decrypt, support AES, RSA, ECDSA, MD5, SHA128, SHA256
    • configserver.go: load configs from file or config-server
  • fs.go: some tools to read, move, walk dir/files
  • http.go: some tools to send http request
  • jwt/: some tools to generate and parse JWT
  • log/: enhanched zap logger
  • math.go: some math tools to deal with int, round
  • net.go: some tools to deal with tcp/udp
  • random.go: generate random string, int
  • sort.go: easier to sort
  • sync.go: some locks depends on atomic
  • throttle.go: faster rate limiter
  • time.go: faster clock (if you do not enable vdso)
  • utils: some useful tools

# Packages

Package utils some useful tools fo Golang # Modules Contains some useful tools in different directories: - `color.go`: colorful code - `compressor.go`: compress and extract dir/files - `configserver.go`: load configs from file or config-server - `email.go`: SMTP email sdk - `encrypt.go`: some tools for encrypt and decrypt, support AES, RSA, ECDSA, MD5, SHA128, SHA256 - `fs.go`: some tools to read, move, walk dir/files - `http.go`: some tools to send http request - `jwt.go`: some tools to generate and parse JWT - `logger.go`: enhanched zap logger - `math.go`: some math tools to deal with int, round - `net.go`: some tools to deal with tcp/udp - `random.go`: generate random string, int - `settings.go`: read configs from file or config-server - `sort.go`: easier to sort - `sync.go`: some locks depends on atomic - `throttle.go`: faster rate limiter - `time.go`: faster clock (if you do not enable vdso) - `utils`: some useful tools.