nurago

module
v1.153.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT

README

nurago

[!IMPORTANT] This project was previously named gogen — same library, same packages, new name. The old github.com/tecnickcom/gogen module path is deprecated; all existing versions remain available via the Go module proxy. To migrate:

go get github.com/tecnickcom/nurago@latest
find . -name '*.go' -exec sed -i 's|github.com/tecnickcom/gogen|github.com/tecnickcom/nurago|g' {} +
go mod tidy

GitHub Release Go Reference Coverage Status OpenSSF Best Practices Sponsor on GitHub

If this project is useful to you, please consider supporting development via GitHub Sponsors.

nurago is a production-oriented collection of modular, reusable Go packages for building services and infrastructure code.

It 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.

Instead of assembling and maintaining ad-hoc helpers per project, you can adopt tested packages with consistent patterns.

Why "nurago"? From nuraghe + Go: the Bronze Age Sardinian stone towers, built without mortar, ~7,000 of which still stand after 3,500 years — modular, stone-solid foundations with no lock-in, which is exactly what this library aims to be.

Source documentation: pkg.go.dev/github.com/tecnickcom/nurago

Table of Contents

  1. Why nurago
  2. Feature Highlights
  3. Benefits Summary
  4. Package Catalog
  5. Developers Quick Start
  6. Running All Tests
  7. How To Create a New Web Service
  8. Contributing

Why nurago

nurago is a good fit for Go teams that want:

  • A consistent utility layer across services
  • Reusable packages rather than project-specific scripts
  • A modular import model without framework lock-in
  • A practical example service to accelerate onboarding
  • A Makefile-driven workflow for test/build/scaffolding

It also includes a generator path:

make project CONFIG=project.cfg

This scaffolds a new web service from the provided configuration.

Feature Highlights

  • Broad package coverage for day-to-day service needs, reducing dependency sprawl and avoiding repeated boilerplate utility code.

  • Production-focused building blocks for HTTP, retries, observability, data stores, and AWS, helping teams ship services faster with less glue code.

  • Consistent conventions across packages that make code reviews easier, maintenance simpler, and APIs more predictable.

  • A testing-first repository culture that supports safer refactoring and more reliable behavior over time.

  • Built-in project scaffolding and a runnable example service to speed up project bootstrap and provide a clearer implementation reference.

Benefits Summary

  • Faster development cycles for new services
  • Less duplicated utility code across repositories
  • Better consistency in operational concerns (logging, metrics, health, tracing)
  • Cleaner architecture through package-level composition
  • Easier onboarding for engineers joining an existing Go platform

Package Catalog

nurago offers a comprehensive set of well-tested packages.

  • 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
  • backoff - Exponential backoff delay schedule with jitter. retry, backoff, jitter
  • 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 in-memory slices (of structs, scalars, or any). 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
  • 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
  • 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
  • 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, argon2id, PHC
  • 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 - Fast single-pass redaction of secrets (headers, JSON, form data, DSNs, JWTs, PEM keys, card numbers) in logs and HTTP dumps. 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
  • tsmap - Thread-safe map implementation. thread-safe, map
  • tsslice - Thread-safe slice implementation. thread-safe, slice
  • timeutil - Time and date utilities. time, date utilities
  • traceid - Trace ID propagation and context management. tracing, ids
  • typeutil - Type conversion and utility functions. type conversion, utilities
  • uhex - Fixed-width, lowercase hexadecimal encoders for unsigned integers and byte arrays. hex, encoding, 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

Developers Quick Start

Requirements:

  • Go (latest stable; repository is configured for Go 1.26)
  • Python 3 (required for additional tests)

Clone and validate the repository:

git clone https://github.com/tecnickcom/nurago.git
cd nurago
make x

The Makefile provides a Linux-friendly workflow for build/test operations. Generated artifacts and reports are written to target/.

To run the same process in Docker:

make dbuild

This uses resources/docker/Dockerfile.dev.

List all available commands:

make help

Running All Tests

Before committing, run:

make x

Or run tests/build inside Docker:

make dbuild

How To Create a New Web Service

The directory examples/service contains a sample web service built with nurago.

To scaffold a new project:

Clone the nurago repository
$ git clone https://github.com/tecnickcom/nurago.git

Cloning into 'nurago'...
Move to the cloned project directory
$ cd nurago/
List available Make targets
$ make

# nurago Makefile.
# GOPATH=/home/demo/GO
# The following commands are available:
#
#   make x              : Test and build everything from scratch
#   make clean          : Remove any build artifact
#   make coverage       : Generate the coverage report
#   make dbuild         : Build everything inside a Docker container
#   make deps           : Get dependencies
#   make dockerdev      : Build a base development Docker image
#   make ensuretarget   : Create the target directories if missing
#   make example        : Build and test the service example
#   make format         : Format the source code
#   make generate       : Generate Go code automatically
#   make govulncheck    : Check dependencies for known vulnerabilities
#   make linter         : Check code against multiple linters
#   make mod            : Download dependencies
#   make project        : Generate a new project from the example using the data set via CONFIG=project.cfg
#   make qa             : Run all tests and static analysis tools
#   make tag            : Tag the Git repository
#   make test           : Run unit tests
#   make bench          : Run benchmarks (without -race or coverage) and store the results for comparison (target/report/bench.txt)
#   make benchbase      : Run base benchmarks (without -race or coverage) and store the results for comparison (target/report/bench_base.txt)
#   make benchcmp       : Compare benchmark allocation counts against a base git ref and fail on regressions (set BENCHBASE=ref, default main)
#   make benchgate      : Compare benchmark allocation counts against a baseline file and fail on regressions (set BASELINE=path/to/baseline.txt)
#   make gotools        : Get the go tools
#   make updateall      : Update everything
#   make updatego       : Update Go version
#   make updatelint     : Update golangci-lint version
#   make updatemod      : Update dependencies
#   make version        : Update this library version in the examples
#   make versionup      : Increase the patch number in the VERSION file
#
# To run the full test and build flow from scratch, use:
#     make x
Run the full test and build pipeline
$ make x

# DEVMODE=LOCAL make version format clean mod deps generate qa example

# 1. make version       : Update this library version in the examples
# 2. make format        : Format the source code
# 3. make clean         : Remove any build artifact
# 4. make mod           : Download dependencies
# 5. make deps          : Get dependencies
# 6. make generate      : Generate Go code automatically (test mocks)
# 7. make qa            : Run all tests and static analysis tools
    # 7.1. make linter      : Check the code with multiple linters (golangci/golangci-lint)
    # 7.2. make test        : Run unit tests (go test)
    # 7.3. make coverage    : Generate the coverage report (/target/report/coverage.html)
# 8. make example       : Build and test the service example
    # 8.1. make clean       : Remove any build artifact
    # 8.2. make mod         : Download dependencies
    # 8.3. make deps        : Get dependencies
    # 8.4. make gendoc      : Generate static documentation from /doc/src (gomplate)
    # 8.5. make generate    : Generate Go code automatically (test mocks)
    # 8.6. make qa          : Run all tests and static analysis tools
        # 8.6.1. make linter    : Check the code with multiple linters (golangci/golangci-lint)
        # 8.6.2. make confcheck : Check the configuration files (jv)
        # 8.6.3. make test      : Run unit tests (go test)
        # 8.6.4. make coverage  : Generate the coverage report (target/report/coverage.html)
    # 8.7. make build       : Compile the application (go build > target/usr/bin/nuragoexample)
Create a new project from the examples/service template
Customize the project configuration file
$ cp project.cfg myproject.cfg

$ nano myproject.cfg
Generate the project
$ make project CONFIG=myproject.cfg

# Project created at target/github.com/test/dummy
Move the project to a new location
$ mv target/github.com/test/dummy ~/GO/src/myproject/
Run the full test suite on the new project
$ cd ~/GO/src/myproject/

$ make x

# DEVMODE=LOCAL make format clean mod deps gendoc generate qa build docker dockertest

#  1. make format      : Format the source code
#  2. make clean       : Remove any build artifact
#  3. make mod         : Download dependencies
#  4. make deps        : Get dependencies
#  5. make gendoc      : Generate static documentation from /doc/src (gomplate)
#  6. make generate    : Generate Go code automatically (test mocks)
#  7. make qa          : Run all tests and static analysis tools
    #  7.1. make linter    : Check the code with multiple linters (golangci/golangci-lint)
    #  7.2. make confcheck : Check the configuration files (jv)
    #  7.3. make test      : Run unit tests (go test)
    #  7.4. make coverage  : Generate the coverage report (target/report/coverage.html)
#  8. make build       : Compile the application (go build > target/usr/bin/nuragoexample)
#  9. make docker      : Build a scratch Docker container to run this service
# 10. make dockertest  : Test the newly built Docker container in an ephemeral Docker Compose environment
    # 10.1. DEPLOY_ENV=int make openapitest apitest
        # 10.1.1. make openapitest : Test the OpenAPI specification with randomly generated Schemathesis tests
        # 10.1.2. make apitest     : Execute API tests with venom

Contributing

Contributions are welcome. Please review CONTRIBUTING.md before opening a pull request.

Directories

Path Synopsis
pkg
awsopt
Package awsopt configures the aws-sdk-go-v2 library consistently across multiple AWS service clients.
Package awsopt configures the aws-sdk-go-v2 library consistently across multiple AWS service clients.
awssecretcache
Package awssecretcache provides a local, thread-safe, fixed-size cache for AWS Secrets Manager lookups, with single-flight deduplication.
Package awssecretcache provides a local, thread-safe, fixed-size cache for AWS Secrets Manager lookups, with single-flight deduplication.
backoff
Package backoff computes successive retry delays with exponential growth, a bounded maximum, and random jitter.
Package backoff computes successive retry delays with exponential growth, a bounded maximum, and random jitter.
bootstrap
Package bootstrap wires together the core infrastructure of a Go service: context lifecycle, structured logging, metrics collection, OS signal handling, and graceful shutdown, in a single function call.
Package bootstrap wires together the core infrastructure of a Go service: context lifecycle, structured logging, metrics collection, OS signal handling, and graceful shutdown, in a single function call.
config
Package config provides configuration bootstrap for Go services built on top of Viper.
Package config provides configuration bootstrap for Go services built on top of Viper.
countrycode
Package countrycode provides access to ISO-3166 country metadata.
Package countrycode provides access to ISO-3166 country metadata.
countryphone
Package countryphone resolves international phone number prefixes into country and regional metadata.
Package countryphone resolves international phone number prefixes into country and regional metadata.
decint
Package decint provides utility functions to parse and represent decimal values as fixed-point integers with a defined precision.
Package decint provides utility functions to parse and represent decimal values as fixed-point integers with a defined precision.
devlake
Package devlake provides a Go client for the DevLake Webhook API.
Package devlake provides a Go client for the DevLake Webhook API.
dnscache
Package dnscache provides a local DNS cache that is safe for concurrent use, bounded in size, and uses single-flight request collapsing to avoid duplicate lookups.
Package dnscache provides a local DNS cache that is safe for concurrent use, bounded in size, and uses single-flight request collapsing to avoid duplicate lookups.
encode
Package encode provides helpers for serialization and deserialization across system boundaries such as databases, queues, caches, and RPC payloads.
Package encode provides helpers for serialization and deserialization across system boundaries such as databases, queues, caches, and RPC payloads.
encrypt
Package encrypt provides helpers for encrypting and decrypting data safely for transport and storage.
Package encrypt provides helpers for encrypting and decrypting data safely for transport and storage.
enumbitmap
Package enumbitmap provides helpers to encode and decode enumeration values as bitmaps.
Package enumbitmap provides helpers to encode and decode enumeration values as bitmaps.
enumcache
Package enumcache provides thread-safe storage and lookup for enumeration name and ID mappings.
Package enumcache provides thread-safe storage and lookup for enumeration name and ID mappings.
enumdb
Package enumdb loads enumeration sets from relational database tables into thread-safe enum caches.
Package enumdb loads enumeration sets from relational database tables into thread-safe enum caches.
errutil
Package errutil provides helpers for error handling in Go applications.
Package errutil provides helpers for error handling in Go applications.
filter
Package filter provides declarative, rule-based filtering for in-memory slices.
Package filter provides declarative, rule-based filtering for in-memory slices.
healthcheck
Package healthcheck provides a framework for defining, executing, and aggregating service health probes.
Package healthcheck provides a framework for defining, executing, and aggregating service health probes.
httpclient
Package httpclient provides a configurable outbound HTTP client with trace propagation and structured request/response logging.
Package httpclient provides a configurable outbound HTTP client with trace propagation and structured request/response logging.
httpretrier
Package httpretrier provides configurable retry execution for outbound HTTP requests.
Package httpretrier provides configurable retry execution for outbound HTTP requests.
httpreverseproxy
Package httpreverseproxy provides a reverse-proxy client built on top of net/http/httputil.ReverseProxy.
Package httpreverseproxy provides a reverse-proxy client built on top of net/http/httputil.ReverseProxy.
httpserver
Package httpserver provides a configurable HTTP server bootstrap for Go services.
Package httpserver provides a configurable HTTP server bootstrap for Go services.
httputil
Package httputil provides HTTP request/response primitives for Go services built on top of net/http.
Package httputil provides HTTP request/response primitives for Go services built on top of net/http.
httputil/jsendx
Package jsendx implements an extended JSend response envelope for HTTP APIs.
Package jsendx implements an extended JSend response envelope for HTTP APIs.
ipify
Package ipify provides a small client to resolve the current instance public IP address using the ipify service (https://www.ipify.org/).
Package ipify provides a small client to resolve the current instance public IP address using the ipify service (https://www.ipify.org/).
jirasrv
Package jirasrv provides a typed HTTP client foundation for Jira Server REST integrations.
Package jirasrv provides a typed HTTP client foundation for Jira Server REST integrations.
jwt
Package jwt provides an HTTP-oriented JWT authentication helper for username/password login flows: validate user credentials, issue short-lived signed JWTs, authorize protected endpoints from an Authorization header, and optionally renew tokens near expiration.
Package jwt provides an HTTP-oriented JWT authentication helper for username/password login flows: validate user credentials, issue short-lived signed JWTs, authorize protected endpoints from an Authorization header, and optionally renew tokens near expiration.
kafka
Package kafka provides a pure-Go API for producing and consuming Apache Kafka messages.
Package kafka provides a pure-Go API for producing and consuming Apache Kafka messages.
logsrv
Package logsrv provides a zerolog backend exposed through the standard log/slog API.
Package logsrv provides a zerolog backend exposed through the standard log/slog API.
logutil
Package logutil provides configuration-driven logging utilities built around Go's standard log/slog package.
Package logutil provides configuration-driven logging utilities built around Go's standard log/slog package.
maputil
Package maputil provides generic functional-style helpers for Go maps.
Package maputil provides generic functional-style helpers for Go maps.
metrics
Package metrics defines a backend-agnostic instrumentation contract for Go services.
Package metrics defines a backend-agnostic instrumentation contract for Go services.
metrics/opentel
Package opentel implements github.com/tecnickcom/nurago/pkg/metrics.Client using OpenTelemetry for both metrics and tracing.
Package opentel implements github.com/tecnickcom/nurago/pkg/metrics.Client using OpenTelemetry for both metrics and tracing.
metrics/prometheus
Package prometheus implements github.com/tecnickcom/nurago/pkg/metrics.Client using the Prometheus client ecosystem.
Package prometheus implements github.com/tecnickcom/nurago/pkg/metrics.Client using the Prometheus client ecosystem.
metrics/statsd
Package statsd implements github.com/tecnickcom/nurago/pkg/metrics.Client using the StatsD protocol.
Package statsd implements github.com/tecnickcom/nurago/pkg/metrics.Client using the StatsD protocol.
mysqllock
Package mysqllock provides process-distributed mutual exclusion using MySQL's named lock primitives GET_LOCK and RELEASE_LOCK.
Package mysqllock provides process-distributed mutual exclusion using MySQL's named lock primitives GET_LOCK and RELEASE_LOCK.
numtrie
Package numtrie provides a generic, digit-indexed [trie] (prefix tree) for associating values of any type with numerical keys, with built-in support for partial/prefix matching and alphabetical (vanity) phone-number keys.
Package numtrie provides a generic, digit-indexed [trie] (prefix tree) for associating values of any type with numerical keys, with built-in support for partial/prefix matching and alphabetical (vanity) phone-number keys.
paging
Package paging computes pagination metadata (current page, total pages, previous/next page numbers, and SQL OFFSET/LIMIT values) from three inputs: current page number, page size, and total item count.
Package paging computes pagination metadata (current page, total pages, previous/next page numbers, and SQL OFFSET/LIMIT values) from three inputs: current page number, page size, and total item count.
passwordhash
Package passwordhash provides OWASP-compliant password hashing and verification using the Argon2id algorithm (RFC 9106), with an optional AES-GCM encryption layer (peppered hashing) for defense in depth.
Package passwordhash provides OWASP-compliant password hashing and verification using the Argon2id algorithm (RFC 9106), with an optional AES-GCM encryption layer (peppered hashing) for defense in depth.
passwordpwned
Package passwordpwned checks whether a password has appeared in a known data breach, using the Have I Been Pwned (HIBP) Pwned Passwords API v3 (https://haveibeenpwned.com/API/v3#PwnedPasswords).
Package passwordpwned checks whether a password has appeared in a known data breach, using the Have I Been Pwned (HIBP) Pwned Passwords API v3 (https://haveibeenpwned.com/API/v3#PwnedPasswords).
periodic
Package periodic schedules a task function to run repeatedly at a fixed interval, with optional random jitter and a per-invocation context timeout.
Package periodic schedules a task function to run repeatedly at a fixed interval, with optional random jitter and a per-invocation context timeout.
phonekeypad
Package phonekeypad converts alphabetic strings and phone number literals to their numeric equivalents on a standard 12-key telephony keypad (ITU E.161 / ITU T.9).
Package phonekeypad converts alphabetic strings and phone number literals to their numeric equivalents on a standard 12-key telephony keypad (ITU E.161 / ITU T.9).
profiling
Package profiling bridges Go's built-in net/http/pprof profiling tool and the httprouter request router, allowing all pprof endpoints to be served through a single wildcard route without manual per-handler registration.
Package profiling bridges Go's built-in net/http/pprof profiling tool and the httprouter request router, allowing all pprof endpoints to be served through a single wildcard route without manual per-handler registration.
random
Package random provides utility functions for generating random bytes, numeric identifiers, UID/UUID values, hexadecimal/base36 IDs, and configurable random strings.
Package random provides utility functions for generating random bytes, numeric identifiers, UID/UUID values, hexadecimal/base36 IDs, and configurable random strings.
redact
Package redact provides pattern-based redaction utilities for obscuring sensitive data before logging or debugging output is emitted.
Package redact provides pattern-based redaction utilities for obscuring sensitive data before logging or debugging output is emitted.
redis
Package redis provides helpers built on go-redis for common application workflows: key/value storage, Pub/Sub messaging, typed payload encoding, and connection health checks.
Package redis provides helpers built on go-redis for common application workflows: key/value storage, Pub/Sub messaging, typed payload encoding, and connection health checks.
retrier
Package retrier provides a configurable retry engine for executing a task function with backoff, jitter, and per-attempt timeouts.
Package retrier provides a configurable retry engine for executing a task function with backoff, jitter, and per-attempt timeouts.
s3
Package s3 provides helpers built on the AWS SDK v2 S3 client for common bucket object operations:
Package s3 provides helpers built on the AWS SDK v2 S3 client for common bucket object operations:
sfcache
Package sfcache provides a local, thread-safe, fixed-size cache for expensive lookups with single-flight deduplication.
Package sfcache provides a local, thread-safe, fixed-size cache for expensive lookups with single-flight deduplication.
slack
Package slack provides a client for sending messages to Slack via Incoming Webhooks.
Package slack provides a client for sending messages to Slack via Incoming Webhooks.
sleuth
Package sleuth provides a Go client for the Sleuth.io API, covering common write-side integrations for delivery metrics and operational signal ingestion.
Package sleuth provides a Go client for the Sleuth.io API, covering common write-side integrations for delivery metrics and operational signal ingestion.
sliceutil
Package sliceutil provides generic, allocation-conscious helpers for common slice operations and numeric dataset summarization.
Package sliceutil provides generic, allocation-conscious helpers for common slice operations and numeric dataset summarization.
sqlconn
Package sqlconn manages a database/sql connection lifecycle in long-running Go services: applying pool limits, verifying connectivity, exposing health checks, and closing the connection on shutdown signals.
Package sqlconn manages a database/sql connection lifecycle in long-running Go services: applying pool limits, verifying connectivity, exposing health checks, and closing the connection on shutdown signals.
sqltransaction
Package sqltransaction executes business logic inside a transaction with begin/commit/rollback control flow and consistent error handling.
Package sqltransaction executes business logic inside a transaction with begin/commit/rollback control flow and consistent error handling.
sqlutil
Package sqlutil quotes identifiers and string literals when generating SQL query fragments dynamically.
Package sqlutil quotes identifiers and string literals when generating SQL query fragments dynamically.
sqlxtransaction
Package sqlxtransaction handles begin/commit/rollback control flow around business logic executed inside a sqlx transaction.
Package sqlxtransaction handles begin/commit/rollback control flow around business logic executed inside a sqlx transaction.
sqs
Package sqs wraps github.com/aws/aws-sdk-go-v2/service/sqs with an API that covers the common queue workflow: send, receive, decode, acknowledge (delete), and health-check.
Package sqs wraps github.com/aws/aws-sdk-go-v2/service/sqs with an API that covers the common queue workflow: send, receive, decode, acknowledge (delete), and health-check.
stringkey
Package stringkey derives a stable, compact, non-cryptographic key from multiple text fields for lookup, deduplication, and idempotency-style identifiers.
Package stringkey derives a stable, compact, non-cryptographic key from multiple text fields for lookup, deduplication, and idempotency-style identifiers.
stringmetric
Package stringmetric provides string distance functions for approximate text matching, comparison, and fuzzy search.
Package stringmetric provides string distance functions for approximate text matching, comparison, and fuzzy search.
strsplit
Package strsplit splits strings into bounded-size chunks without breaking Unicode characters, keeping human-readable boundaries (spaces, punctuation, and newlines).
Package strsplit splits strings into bounded-size chunks without breaking Unicode characters, keeping human-readable boundaries (spaces, punctuation, and newlines).
testutil
Package testutil provides test-only helpers for forcing I/O failures on demand, capturing process output, bootstrapping HTTP handlers, and normalizing time-variant values in assertions.
Package testutil provides test-only helpers for forcing I/O failures on demand, capturing process output, bootstrapping HTTP handlers, and normalizing time-variant values in assertions.
threadsafe
Package threadsafe defines lock interfaces for building reusable, goroutine-safe data structures and helpers without hard-coding a concrete lock type.
Package threadsafe defines lock interfaces for building reusable, goroutine-safe data structures and helpers without hard-coding a concrete lock type.
threadsafe/tsmap
Package tsmap provides lock-aware generic helpers for operating on Go maps shared across multiple goroutines, keeping synchronization explicit at every call site.
Package tsmap provides lock-aware generic helpers for operating on Go maps shared across multiple goroutines, keeping synchronization explicit at every call site.
threadsafe/tsslice
Package tsslice provides lock-aware generic helpers for operating on Go slices shared across multiple goroutines, keeping synchronization explicit around every access.
Package tsslice provides lock-aware generic helpers for operating on Go slices shared across multiple goroutines, keeping synchronization explicit around every access.
timeutil
Package timeutil provides two JSON-friendly time types.
Package timeutil provides two JSON-friendly time types.
traceid
Package traceid captures a request-scoped trace ID at the service boundary: it reads the ID from an inbound HTTP header, propagates it through the context.Context for the lifetime of the request, and writes it back into outbound HTTP headers when calling downstream services, without coupling business logic to any particular tracing framework.
Package traceid captures a request-scoped trace ID at the service boundary: it reads the ID from an inbound HTTP header, propagates it through the context.Context for the lifetime of the request, and writes it back into outbound HTTP headers when calling downstream services, without coupling business logic to any particular tracing framework.
typeutil
Package typeutil provides type-handling helpers for Go generics code: detecting nil through interfaces, obtaining zero values generically, dereferencing pointers safely, and converting booleans to integers without a branch.
Package typeutil provides type-handling helpers for Go generics code: detecting nil through interfaces, obtaining zero values generically, dereferencing pointers safely, and converting booleans to integers without a branch.
uhex
Package uhex provides fixed-width, lowercase hexadecimal encoders for unsigned integers and fixed-size byte arrays.
Package uhex provides fixed-width, lowercase hexadecimal encoders for unsigned integers and fixed-size byte arrays.
validator
Package validator wraps https://github.com/go-playground/validator and adds custom validation rules, a template-based error translation engine, and a functional-options API.
Package validator wraps https://github.com/go-playground/validator and adds custom validation rules, a template-based error translation engine, and a functional-options API.
valkey
Package valkey wraps the valkey-go client (https://github.com/valkey-io/valkey-go) for Valkey (https://valkey.io), a Redis-compatible in-memory data store.
Package valkey wraps the valkey-go client (https://github.com/valkey-io/valkey-go) for Valkey (https://valkey.io), a Redis-compatible in-memory data store.

Jump to

Keyboard shortcuts

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