go

module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: BSD-3-Clause

README

Go Utils

GitHub Workflow Status Coveralls github GitHub go.mod Go version Go Report Card Release GitHub license

Common Go utilities for web services, with Hertz-friendly integrations.

Install

go get github.com/kainonly/go

Packages

Package Purpose
vd Validator wrapper and Hertz integration
passport JWT auth helpers
csrf CSRF protection middleware
captcha Redis-backed captcha verification
locker Redis-backed counters and lockout helpers
passlib Password hashing and verification
totp TOTP secret generation and validation
cipher Symmetric encryption helpers
help Small utility helpers

Usage

Import only the package you need:

import "github.com/kainonly/go/vd"

validate := vd.Default()
_ = validate.Validate(req)

Detailed usage is kept in package comments:

go doc github.com/kainonly/go/vd
go doc github.com/kainonly/go/passport
go doc github.com/kainonly/go/csrf

License

BSD-3-Clause License

Directories

Path Synopsis
Package captcha provides verification code management with Redis storage.
Package captcha provides verification code management with Redis storage.
Package cipher provides symmetric encryption using XChaCha20-Poly1305.
Package cipher provides symmetric encryption using XChaCha20-Poly1305.
Package csrf provides CSRF (Cross-Site Request Forgery) protection middleware for Hertz.
Package csrf provides CSRF (Cross-Site Request Forgery) protection middleware for Hertz.
Package help provides common utility functions for Go applications.
Package help provides common utility functions for Go applications.
Package locker provides rate limiting and attempt counting with Redis storage.
Package locker provides rate limiting and attempt counting with Redis storage.
Package passlib provides password hashing using Argon2id algorithm.
Package passlib provides password hashing using Argon2id algorithm.
Package passport provides JWT (JSON Web Token) authentication utilities for Hertz.
Package passport provides JWT (JSON Web Token) authentication utilities for Hertz.
Package totp provides TOTP (Time-based One-Time Password) generation and validation.
Package totp provides TOTP (Time-based One-Time Password) generation and validation.
Package vd provides a configurable validator wrapper for go-playground/validator with Hertz framework integration and custom validation rules support.
Package vd provides a configurable validator wrapper for go-playground/validator with Hertz framework integration and custom validation rules support.

Jump to

Keyboard shortcuts

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