{"id":33597299,"url":"https://github.com/tecnickcom/gogen","last_synced_at":"2026-04-11T15:14:58.131Z","repository":{"id":66250106,"uuid":"71342384","full_name":"tecnickcom/gogen","owner":"tecnickcom","description":"Open-Source collection of high-quality Go (Golang) packages.","archived":false,"fork":false,"pushed_at":"2026-03-28T15:40:01.000Z","size":5574,"stargazers_count":21,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-03-28T17:13:42.600Z","etag":null,"topics":["application","boilerplate","builder","code","generator","golang","library","packages","project","service","template"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tecnickcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ"]}},"created_at":"2016-10-19T09:45:22.000Z","updated_at":"2026-03-28T15:30:43.000Z","dependencies_parsed_at":"2026-03-06T13:00:37.165Z","dependency_job_id":null,"html_url":"https://github.com/tecnickcom/gogen","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/tecnickcom/gogen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecnickcom%2Fgogen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecnickcom%2Fgogen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecnickcom%2Fgogen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecnickcom%2Fgogen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tecnickcom","download_url":"https://codeload.github.com/tecnickcom/gogen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecnickcom%2Fgogen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application","boilerplate","builder","code","generator","golang","library","packages","project","service","template"],"created_at":"2025-11-30T02:07:07.901Z","updated_at":"2026-04-01T17:51:00.694Z","avatar_url":"https://github.com/tecnickcom.png","language":"Go","funding_links":["https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ"],"categories":[],"sub_categories":[],"readme":"# gogen\n\n[![GitHub Release](https://img.shields.io/github/v/release/tecnickcom/gogen)](https://github.com/tecnickcom/gogen/releases)\n[![Go Reference](https://pkg.go.dev/badge/github.com/tecnickcom/gogen.svg)](https://pkg.go.dev/github.com/tecnickcom/gogen)\n[![Coverage Status](https://coveralls.io/repos/github/tecnickcom/gogen/badge.svg?branch=main)](https://coveralls.io/github/tecnickcom/gogen?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/tecnickcom/gogen)](https://goreportcard.com/report/github.com/tecnickcom/gogen)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11517/badge)](https://www.bestpractices.dev/projects/11517)\n\n[![Donate via PayPal](https://img.shields.io/badge/donate-paypal-87ceeb.svg)](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)\nPlease consider supporting this project by making a donation via [PayPal](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ).\n\n![gogen logo](gogen_logo.png)\n\n**`gogen` is a production-oriented collection of modular, reusable Go packages for building services and infrastructure code.**\n\nIt solves a common problem in backend teams: repeatedly re-implementing the same foundational components (configuration loading, retries, health checks, logging, metrics, AWS integration, validation, caching, and more) across multiple repositories.\n\nInstead of assembling and maintaining ad-hoc helpers per project, you can adopt tested packages with consistent patterns.\n\nSource documentation: [pkg.go.dev/github.com/tecnickcom/gogen](https://pkg.go.dev/github.com/tecnickcom/gogen)\n\n## Table of Contents\n\n1. [Why gogen](#why-gogen)\n2. [Feature Highlights](#feature-highlights)\n3. [Benefits Summary](#benefits-summary)\n4. [Package Catalog](#package-catalog)\n5. [Developers Quick Start](#developers-quick-start)\n6. [Running All Tests](#running-all-tests)\n7. [How To Create a New Web Service](#web-service-project-example)\n8. [Contributing](#contributing)\n\n## Why gogen\n\n`gogen` is a good fit for Go teams that want:\n\n- A consistent utility layer across services\n- Reusable packages rather than project-specific scripts\n- A modular import model without framework lock-in\n- A practical example service to accelerate onboarding\n- A Makefile-driven workflow for test/build/scaffolding\n\nIt also includes a generator path:\n\n```bash\nmake project CONFIG=project.cfg\n```\n\nThis scaffolds a new web service from the provided configuration.\n\n## Feature Highlights\n\n- Broad package coverage for day-to-day service needs  \nWhy it matters: reduce dependency sprawl and avoid rewriting boilerplate utilities.\n\n- Production-focused building blocks (HTTP, retries, observability, data stores, AWS)  \nWhy it matters: ship services faster with less glue code.\n\n- Consistent conventions across packages  \nWhy it matters: easier code reviews, simpler maintenance, and predictable APIs.\n\n- Testing-first repository culture  \nWhy it matters: safer refactoring and more reliable behavior over time.\n\n- Built-in project scaffolding and runnable example service  \nWhy it matters: faster project bootstrap and clearer implementation reference.\n\n## Benefits Summary\n\n- Faster development cycles for new services\n- Less duplicated utility code across repositories\n- Better consistency in operational concerns (logging, metrics, health, tracing)\n- Cleaner architecture through package-level composition\n- Easier onboarding for engineers joining an existing Go platform\n\n## Package Catalog\n\n`gogen` offers a comprehensive set of well-tested packages.\n\n- [awsopt](pkg/awsopt) - Utilities for configuring common AWS options with the aws-sdk-go-v2 library. `aws`, `configuration`\n- [awssecretcache](pkg/awssecretcache) - Client for retrieving and caching secrets from AWS Secrets Manager. `aws`, `secrets`, `caching`\n- [bootstrap](pkg/bootstrap) - Helpers for application bootstrap and initialization. `bootstrap`, `initialization`\n- [config](pkg/config) - Utilities for configuration loading and management. `configuration`\n- [countrycode](pkg/countrycode) - Functions for country code lookup and validation. `geolocation`, `validation`\n- [countryphone](pkg/countryphone) - Phone number parsing and country association. `phone`, `geolocation`, `parsing`\n- [decint](pkg/decint) - Helpers for parsing and formatting decimal integers. `numeric`, `formatting`, `parsing`\n- [devlake](pkg/devlake) - Client for the DevLake Webhook API. `webhook`, `api client`\n- [dnscache](pkg/dnscache) - DNS resolution with caching support. `dns`, `caching`, `networking`\n- [encode](pkg/encode) - Utilities for data encoding and serialization. `encoding`, `serialization`\n- [encrypt](pkg/encrypt) - Helpers for encryption and decryption. `encryption`, `security`\n- [enumbitmap](pkg/enumbitmap) - Encode and decode slices of enumeration strings as integer bitmap values. `enum`, `bitmap`, `encoding`\n- [enumcache](pkg/enumcache) - Caching for enumeration values with bitmap support. `enum`, `caching`\n- [enumdb](pkg/enumdb) - Helpers for storing and retrieving enumeration sets in databases. `enum`, `database`\n- [errutil](pkg/errutil) - Error utility functions, including error tracing. `error handling`, `utilities`\n- [filter](pkg/filter) - Generic rule-based filtering for struct slices. `filtering`, `collections`\n- [healthcheck](pkg/healthcheck) - Health check endpoints and logic. `health`, `monitoring`\n- [httpclient](pkg/httpclient) - HTTP client with enhanced features. `http`, `client`\n- [httpretrier](pkg/httpretrier) - HTTP request retry logic. `http`, `retry`\n- [httpreverseproxy](pkg/httpreverseproxy) - HTTP reverse proxy implementation. `http`, `reverse proxy`\n- [httpserver](pkg/httpserver) - HTTP server setup and management. `http`, `server`\n- [httputil](pkg/httputil) - HTTP utility functions. `http`, `utilities`\n- [jsendx](pkg/httputil/jsendx) - Helpers for JSend-compliant responses. `http`, `response formatting`\n- [ipify](pkg/ipify) - IP address lookup using the ipify service. `ip lookup`, `networking`, `external service`\n- [jirasrv](pkg/jirasrv) - Client for Jira server APIs. `api client`, `integration`\n- [jwt](pkg/jwt) - JSON Web Token creation and validation. `jwt`, `authentication`, `security`\n- [kafka](pkg/kafka) - Kafka producer and consumer utilities. `kafka`, `messaging`\n- [kafkacgo](pkg/kafkacgo) - Kafka integration using CGO bindings. `kafka`, `messaging`, `cgo`\n- [logsrv](pkg/logsrv) - Default slog logger with zerolog handler. `logging`, `slog`, `zerolog`\n- [logutil](pkg/logutil) - General log utilities for log/slog integration. `logging`, `utilities`\n- [maputil](pkg/maputil) - Helpers for Go map manipulation. `map utilities`, `collections`\n- [metrics](pkg/metrics) - Metrics collection and reporting. `metrics`, `monitoring`\n- [opentel](pkg/metrics/opentel) - OpenTelemetry metrics exporter (includes tracing). `opentelemetry`, `metrics`, `tracing`\n- [prometheus](pkg/metrics/prometheus) - Prometheus metrics exporter. `prometheus`, `metrics`\n- [statsd](pkg/metrics/statsd) - StatsD metrics exporter. `statsd`, `metrics`\n- [mysqllock](pkg/mysqllock) - Distributed locking using MySQL. `mysql`, `locking`, `distributed`\n- [numtrie](pkg/numtrie) - Trie data structure for numeric keys with partial matching. `data structure`, `trie`\n- [paging](pkg/paging) - Helpers for data pagination. `pagination`, `utilities`\n- [passwordhash](pkg/passwordhash) - Password hashing and verification. `password hashing`, `security`\n- [passwordpwned](pkg/passwordpwned) - Password breach checking via HaveIBeenPwned. `password breach`, `security`\n- [periodic](pkg/periodic) - Periodic task scheduling. `scheduling`, `tasks`\n- [phonekeypad](pkg/phonekeypad) - Phone keypad mapping utilities. `phone`, `mapping`, `utilities`\n- [profiling](pkg/profiling) - Application profiling tools. `profiling`, `performance`\n- [random](pkg/random) - Utilities for random data generation, including UUID. `random`, `utilities`\n- [redact](pkg/redact) - Data redaction helpers. `redaction`, `privacy`\n- [redis](pkg/redis) - Redis client and utilities. `redis`, `database`, `caching`\n- [retrier](pkg/retrier) - Retry logic for operations. `retry`, `utilities`\n- [s3](pkg/s3) - Helpers for AWS S3 integration. `aws`, `s3`\n- [sfcache](pkg/sfcache) - Simple in-memory, thread-safe, fixed-size, single-flight cache for expensive lookups. `caching`, `thread-safe`, `single-flight`\n- [slack](pkg/slack) - Client for sending messages via the Slack API Webhook. `slack`, `webhook`, `messaging`\n- [sleuth](pkg/sleuth) - Client for the Sleuth.io API. `api client`, `integration`\n- [sliceutil](pkg/sliceutil) - Utilities for slice manipulation. `slice utilities`, `collections`\n- [sqlconn](pkg/sqlconn) - Helpers for SQL database connections. `sql`, `database`\n- [sqltransaction](pkg/sqltransaction) - SQL transaction management. `sql`, `transactions`\n- [sqlutil](pkg/sqlutil) - SQL utility functions. `sql`, `utilities`\n- [sqlxtransaction](pkg/sqlxtransaction) - Helpers for SQLX transactions. `sqlx`, `transactions`\n- [sqs](pkg/sqs) - Utilities for AWS SQS (Simple Queue Service) integration. `aws`, `sqs`, `messaging`\n- [stringkey](pkg/stringkey) - Create unique hash keys from multiple strings. `string keys`, `hashing`\n- [stringmetric](pkg/stringmetric) - String similarity and distance metrics. `text similarity`, `metrics`\n- [strsplit](pkg/strsplit) - Utilities to split strings and Unicode text. `string utilities`, `text`\n- [testutil](pkg/testutil) - Utilities for testing. `testing`, `utilities`\n- [threadsafe](pkg/threadsafe) - Thread-safe data structures. `thread-safe`, `concurrency`\n- [tsmap](pkg/threadsafe/tsmap) - Thread-safe map implementation. `thread-safe`, `map`\n- [tsslice](pkg/threadsafe/tsslice) - Thread-safe slice implementation. `thread-safe`, `slice`\n- [timeutil](pkg/timeutil) - Time and date utilities. `time`, `date utilities`\n- [traceid](pkg/traceid) - Trace ID generation and management. `tracing`, `ids`\n- [typeutil](pkg/typeutil) - Type conversion and utility functions. `type conversion`, `utilities`\n- [validator](pkg/validator) - Data validation utilities. `validation`, `utilities`\n- [valkey](pkg/valkey) - Wrapper client for interacting with valkey.io, an open-source in-memory data store. `data store`, `client`\n\n## Developers Quick Start\n\nRequirements:\n\n- Go (latest stable; repository is configured for Go 1.26)\n- Python 3 (required for additional tests)\n\nClone and validate the repository:\n\n```bash\ngit clone https://github.com/tecnickcom/gogen.git\ncd gogen\nmake x\n```\n\nThe `Makefile` provides a Linux-friendly workflow for build/test operations. Generated artifacts and reports are written to `target/`.\n\nTo run the same process in Docker:\n\n```bash\nmake dbuild\n```\n\nThis uses `resources/docker/Dockerfile.dev`.\n\nList all available commands:\n\n```bash\nmake help\n```\n\n## Running All Tests\n\nBefore committing, run:\n\n```bash\nmake x\n```\n\nOr run tests/build inside Docker:\n\n```bash\nmake dbuild\n```\n\n## How To Create a New Web Service\n\nThe directory `examples/service` contains a sample web service built with `gogen`.\n\nTo scaffold a new project:\n\n### Clone the gogen repository\n\n```bash\n$ git clone https://github.com/tecnickcom/gogen.git\n\nCloning into 'gogen'...\n```\n\n### Move to the cloned project directory\n\n```bash\n$ cd gogen/\n```\n\n### List available Make targets\n\n```bash\n$ make\n\n# gogen Makefile.\n# GOPATH=/home/demo/GO\n# The following commands are available:\n#\n#   make x              : Test and build everything from scratch\n#   make clean          : Remove any build artifact\n#   make coverage       : Generate the coverage report\n#   make dbuild         : Build everything inside a Docker container\n#   make deps           : Get dependencies\n#   make dockerdev      : Build a base development Docker image\n#   make ensuretarget   : Create the target directories if missing\n#   make example        : Build and test the service example\n#   make format         : Format the source code\n#   make generate       : Generate Go code automatically\n#   make linter         : Check code against multiple linters\n#   make mod            : Download dependencies\n#   make project        : Generate a new project from the example using the data set via CONFIG=project.cfg\n#   make qa             : Run all tests and static analysis tools\n#   make tag            : Tag the Git repository\n#   make test           : Run unit tests\n#   make gotools        : Get the go tools\n#   make updateall      : Update everything\n#   make updatego       : Update Go version\n#   make updatelint     : Update golangci-lint version\n#   make updatemod      : Update dependencies\n#   make version        : Update this library version in the examples\n#   make versionup      : Increase the patch number in the VERSION file\n#\n# To run the full test and build flow from scratch, use:\n#     make x\n```\n\n### Run the full test and build pipeline\n\n```bash\n$ make x\n\n# DEVMODE=LOCAL make version format clean mod deps generate qa example\n\n# 1. make version       : Update this library version in the examples\n# 2. make format        : Format the source code\n# 3. make clean         : Remove any build artifact\n# 4. make mod           : Download dependencies\n# 5. make deps          : Get dependencies\n# 6. make generate      : Generate Go code automatically (test mocks)\n# 7. make qa            : Run all tests and static analysis tools\n    # 7.1. make linter      : Check the code with multiple linters (golangci/golangci-lint)\n    # 7.2. make test        : Run unit tests (go test)\n    # 7.3. make coverage    : Generate the coverage report (/target/report/coverage.html)\n# 8. make example       : Build and test the service example\n    # 8.1. make clean       : Remove any build artifact\n    # 8.2. make mod         : Download dependencies\n    # 8.3. make deps        : Get dependencies\n    # 8.4. make gendoc      : Generate static documentation from /doc/src (gomplate)\n    # 8.5. make generate    : Generate Go code automatically (test mocks)\n    # 8.6. make qa          : Run all tests and static analysis tools\n        # 8.6.1. make linter    : Check the code with multiple linters (golangci/golangci-lint)\n        # 8.6.2. make confcheck : Check the configuration files (jv)\n        # 8.6.3. make test      : Run unit tests (go test)\n        # 8.6.4. make coverage  : Generate the coverage report (target/report/coverage.html)\n    # 8.7. make build       : Compile the application (go build \u003e target/usr/bin/gogenexample)\n```\n\n### Create a new project from the examples/service template\n\n#### Customize the project configuration file\n\n```bash\n$ cp project.cfg myproject.cfg\n\n$ nano myproject.cfg\n```\n\n#### Generate the project\n\n```bash\n$ make project CONFIG=myproject.cfg\n\n# Project created at target/github.com/test/dummy\n```\n\n#### Move the project to a new location\n\n```bash\n$ mv target/github.com/test/dummy ~/GO/src/myproject/\n```\n\n#### Run the full test suite on the new project\n\n```bash\n$ cd ~/GO/src/myproject/\n\n$ make x\n\n# DEVMODE=LOCAL make format clean mod deps gendoc generate qa build docker dockertest\n\n#  1. make format      : Format the source code\n#  2. make clean       : Remove any build artifact\n#  3. make mod         : Download dependencies\n#  4. make deps        : Get dependencies\n#  5. make gendoc      : Generate static documentation from /doc/src (gomplate)\n#  6. make generate    : Generate Go code automatically (test mocks)\n#  7. make qa          : Run all tests and static analysis tools\n    #  7.1. make linter    : Check the code with multiple linters (golangci/golangci-lint)\n    #  7.2. make confcheck : Check the configuration files (jv)\n    #  7.3. make test      : Run unit tests (go test)\n    #  7.4. make coverage  : Generate the coverage report (target/report/coverage.html)\n#  8. make build       : Compile the application (go build \u003e target/usr/bin/gogenexample)\n#  9. make docker      : Build a scratch Docker container to run this service\n# 10. make dockertest  : Test the newly built Docker container in an ephemeral Docker Compose environment\n    # 10.1. DEPLOY_ENV=int make openapitest apitest\n        # 10.1.1. make openapitest : Test the OpenAPI specification with randomly generated Schemathesis tests\n        # 10.1.2. make apitest     : Execute API tests with venom\n```\n\n## Contributing\n\nContributions are welcome. Please review [CONTRIBUTING.md](https://github.com/tecnickcom/gogen/blob/main/CONTRIBUTING.md) before opening a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecnickcom%2Fgogen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftecnickcom%2Fgogen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecnickcom%2Fgogen/lists"}