go-pkg is a zero-business-logic, highly modular set of utilities for Go backend services. It is designed to be fully open-source compatible, robust, and extensible.
Each package is designed to be tightly scoped with minimal dependencies across packages.
- config: Environment and File-based generic configuration loading.
- api: Helper structs and utilities for the Echo web framework (extensible to other frameworks like Chi/Gin).
- crypto: Generic AES-256-GCM authenticated encryption and BCrypt credential hashing.
- httperr: Structured and actionable error types for web APIs (
ServiceError). - logger: Generic JSON/text logger wrapping
log/slogwith Context extractors and multi-handler fan out. - pgsql: Configurable PostgreSQL connection helpers with transaction context wrappers.
- sanitizer: Extensible, configuration-driven HTML sanitization (prevents XSS).
- timeutil: Timestamp and pointer time utilities.
- uuidutil: Common identifier types, mapping safely to
database/sqldriver implementations. - validator: Framework-agnostic validation helpers over
go-playground/validatorwith strict JSON decoding utilities. - validator/echo: Echo integration helpers (binding + strict validation) without coupling the core
validatorpackage to Echo.
Validate the library with:
make audit