Please consider supporting this project by making a donation via PayPal
This open-source project provides a collection of high-quality Go (Golang) packages.
Have you ever struggled with stitching together the small but essential pieces of infrastructure for a Go service, such as configuration loading, retries, health checks, logging, metrics, AWS integration, validation, and cache handling, only to end up copying the same helper functions from project to project?
That's exactly the problem gogen solves.
gogen is built for teams that want:
- A consistent set of high-quality utilities across services
- Reusable helper packages instead of ad hoc scripts
- A modular import model, not a framework lock-in
- A strong example-driven starting point via service
- A Makefile workflow for testing, building, and scaffolding
It also includes a generator path: make project CONFIG=project.cfg can scaffold a new web service, giving you a fast start with sane defaults.
If you need a solid set of reusable Go packages for web services, infrastructure glue, or AWS integrations, gogen is worth a look.
The source code documentation is available at: https://pkg.go.dev/github.com/tecnickcom/gogen/
gogen offers a comprehensive collection of well-tested Go packages.
Each package adheres to common conventions and coding standards, making them easy to integrate into your projects.
- awsopt - Utilities for configuring common AWS options with the aws-sdk-go-v2 library. [
aws,configuration] - awssecretcache - Client for retrieving and caching secrets from AWS Secrets Manager. [
aws,secrets,caching] - bootstrap - Helpers for application bootstrap and initialization. [
bootstrap,initialization] - config - Utilities for configuration loading and management. [
configuration] - countrycode - Functions for country code lookup and validation. [
geolocation,validation] - countryphone - Phone number parsing and country association. [
phone,geolocation,parsing] - decint - Helpers for parsing and formatting decimal integers. [
numeric,formatting,parsing] - devlake - Client for the DevLake Webhook API. [
webhook,api client] - dnscache - DNS resolution with caching support. [
dns,caching,networking] - encode - Utilities for data encoding and serialization. [
encoding,serialization] - encrypt - Helpers for encryption and decryption. [
encryption,security] - enumbitmap - Encode and decode slices of enumeration strings as integer bitmap values. [
enum,bitmap,encoding] - enumcache - Caching for enumeration values with bitmap support. [
enum,caching] - enumdb - Helpers for storing and retrieving enumeration sets in databases. [
enum,database] - errutil - Error utility functions, including error tracing. [
error handling,utilities] - filter - Generic rule-based filtering for struct slices. [
filtering,collections] - healthcheck - Health check endpoints and logic. [
health,monitoring] - httpclient - HTTP client with enhanced features. [
http,client] - httpretrier - HTTP request retry logic. [
http,retry] - httpreverseproxy - HTTP reverse proxy implementation. [
http,reverse proxy] - httpserver - HTTP server setup and management. [
http,server] - httputil - HTTP utility functions. [
http,utilities]- jsendx - Helpers for JSend-compliant responses. [
http,response formatting]
- jsendx - Helpers for JSend-compliant responses. [
- ipify - IP address lookup using the ipify service. [
ip lookup,networking,external service] - jirasrv - Client for Jira server APIs. [
api client,integration] - jwt - JSON Web Token creation and validation. [
jwt,authentication,security] - kafka - Kafka producer and consumer utilities. [
kafka,messaging] - kafkacgo - Kafka integration using CGO bindings. [
kafka,messaging,cgo] - logsrv - Default slog logger with zerolog handler. [
logging,slog,zerolog] - logutil - General log utilities for log/slog integration. [
logging,utilities] - maputil - Helpers for Go map manipulation. [
map utilities,collections] - metrics - Metrics collection and reporting. [
metrics,monitoring]- opentel - OpenTelemetry metrics exporter (includes tracing). [
opentelemetry,metrics,tracing] - prometheus - Prometheus metrics exporter. [
prometheus,metrics] - statsd - StatsD metrics exporter. [
statsd,metrics]
- opentel - OpenTelemetry metrics exporter (includes tracing). [
- mysqllock - Distributed locking using MySQL. [
mysql,locking,distributed] - numtrie - Trie data structure for numeric keys with partial matching. [
data structure,trie] - paging - Helpers for data pagination. [
pagination,utilities] - passwordhash - Password hashing and verification. [
password hashing,security] - passwordpwned - Password breach checking via HaveIBeenPwned. [
password breach,security] - periodic - Periodic task scheduling. [
scheduling,tasks] - phonekeypad - Phone keypad mapping utilities. [
phone,mapping,utilities] - profiling - Application profiling tools. [
profiling,performance] - random - Utilities for random data generation, including UUID. [
random,utilities] - redact - Data redaction helpers. [
redaction,privacy] - redis - Redis client and utilities. [
redis,database,caching] - retrier - Retry logic for operations. [
retry,utilities] - s3 - Helpers for AWS S3 integration. [
aws,s3] - sfcache - Simple, in-memory, thread-safe, fixed-size, single-flight cache for expensive lookups. [
caching,thread-safe,single-flight] - slack - Client for sending messages via the Slack API Webhook. [
slack,webhook,messaging] - sleuth - Client for the Sleuth.io API. [
api client,integration] - sliceutil - Utilities for slice manipulation. [
slice utilities,collections] - sqlconn - Helpers for SQL database connections. [
sql,database] - sqltransaction - SQL transaction management. [
sql,transactions] - sqlutil - SQL utility functions. [
sql,utilities] - sqlxtransaction - Helpers for SQLX transactions. [
sqlx,transactions] - sqs - Utilities for AWS SQS (Simple Queue Service) integration. [
aws,sqs,messaging] - stringkey - Create unique hash keys from multiple strings. [
string keys,hashing] - stringmetric - String similarity and distance metrics. [
text similarity,metrics] - strsplit - Utilities to split strings and Unicode text. [
string utilities,text] - testutil - Utilities for testing. [
testing,utilities] - threadsafe - Thread-safe data structures. [
thread-safe,concurrency] - timeutil - Time and date utilities. [
time,date utilities] - traceid - Trace ID generation and management. [
tracing,ids] - typeutil - Type conversion and utility functions. [
type conversion,utilities] - validator - Data validation utilities. [
validation,utilities] - valkey - Wrapper client for interacting with valkey.io, an open-source in-memory data store. [
data store,client]
To get started quickly with this project, follow these steps:
-
Ensure you have the latest versions of Go and Python 3 installed (Python is required for additional tests).
-
Clone the repository:
git clone https://github.com/tecnickcom/gogen.git
-
Navigate to the project directory:
cd gogen -
Install dependencies and run all tests:
make x
You are now ready to start developing with gogen!
This project includes a Makefile that simplifies testing and building on Linux-compatible systems. All artifacts and reports generated by the Makefile are stored in the target folder.
Alternatively, you can build the project inside a Docker container using:
make dbuildThis command uses the environment defined in resources/docker/Dockerfile.dev.
To view all available Makefile options, run:
make helpIf you would like to contribute, please review the CONTRIBUTING.md guidelines.
Before committing your code, ensure it is properly formatted and passes all tests by running:
make xAlternatively, you can build and test the project inside a Docker container with:
make dbuildRefer to the examples/service directory for a sample web service built using this library.
To create a new project based on the example and the settings defined in project.cfg, run:
make project CONFIG=project.cfg