Directories
¶
| Path | Synopsis |
|---|---|
|
Package apperror defines canonical application-level error codes and a structured Error type for use across microservices.
|
Package apperror defines canonical application-level error codes and a structured Error type for use across microservices. |
|
Package async provides panic-safe concurrency primitives, asynchronous goroutine runners, and bounded parallel task executors with context cancellation.
|
Package async provides panic-safe concurrency primitives, asynchronous goroutine runners, and bounded parallel task executors with context cancellation. |
|
Package bodylimit provides an HTTP middleware that enforces a maximum request body size.
|
Package bodylimit provides an HTTP middleware that enforces a maximum request body size. |
|
Package cache provides a thread-safe, singleflight-protected in-memory cache with TTL.
|
Package cache provides a thread-safe, singleflight-protected in-memory cache with TTL. |
|
Package circuitbreaker provides an outbound failure state machine for microservice resilience.
|
Package circuitbreaker provides an outbound failure state machine for microservice resilience. |
|
Package clock provides an abstract interface for time-based operations, enabling deterministic, sleep-free testing of time-dependent components.
|
Package clock provides an abstract interface for time-based operations, enabling deterministic, sleep-free testing of time-dependent components. |
|
Package compress provides production-hardened HTTP response compression (Brotli "br" and Gzip "gzip") with RFC 9110 Accept-Encoding q-value negotiation, pooled writers, threshold buffering, and bounded request body decompression with zip-bomb protection.
|
Package compress provides production-hardened HTTP response compression (Brotli "br" and Gzip "gzip") with RFC 9110 Accept-Encoding q-value negotiation, pooled writers, threshold buffering, and bounded request body decompression with zip-bomb protection. |
|
Package cryptoutil provides domain-agnostic cryptographic helpers.
|
Package cryptoutil provides domain-agnostic cryptographic helpers. |
|
Package db manages PostgreSQL pgxpool connections and transaction contexts.
|
Package db manages PostgreSQL pgxpool connections and transaction contexts. |
|
Package env provides zero-dependency typed environment variable retrieval with sensible fallbacks and strict Must* panic assertions for application bootstrap.
|
Package env provides zero-dependency typed environment variable retrieval with sensible fallbacks and strict Must* panic assertions for application bootstrap. |
|
Package etag provides RFC 9110 ETag / If-None-Match (304 Not Modified) and version-gated HTTP middleware with volatile JSON key stripping and client app version auto-bust support.
|
Package etag provides RFC 9110 ETag / If-None-Match (304 Not Modified) and version-gated HTTP middleware with volatile JSON key stripping and client app version auto-bust support. |
|
Package fsm provides a lightweight, declarative, in-memory Finite State Machine for validating state transitions across domain lifecycles.
|
Package fsm provides a lightweight, declarative, in-memory Finite State Machine for validating state transitions across domain lifecycles. |
|
Package ginmw provides HTTP body size limiting middleware.
|
Package ginmw provides HTTP body size limiting middleware. |
|
Package health provides zero-dependency HTTP health check handlers decoupling Kubernetes liveness (/healthz, /livez) from dependency readiness (/readyz).
|
Package health provides zero-dependency HTTP health check handlers decoupling Kubernetes liveness (/healthz, /livez) from dependency readiness (/readyz). |
|
Package httpclient provides an enterprise-grade, composed resilient HTTP client and http.RoundTripper middleware stack for Go microservices.
|
Package httpclient provides an enterprise-grade, composed resilient HTTP client and http.RoundTripper middleware stack for Go microservices. |
|
Package httpmw provides a unified, lightweight standard-library net/http middleware suite with full parity to ginmw (RequestID, LimitBody, Compress, PrecompressedFileServer, ETag, SecurityHeaders, LoopbackGuard, CORS, Recovery, Logger, REDMetrics, MetricsEndpoint, RateLimit, RBAC permissions, RequireTenant, and SSE) while pulling zero Gin, pgx, or OpenTelemetry dependencies — ideal for stdlib net/http BFFs and desktop binaries.
|
Package httpmw provides a unified, lightweight standard-library net/http middleware suite with full parity to ginmw (RequestID, LimitBody, Compress, PrecompressedFileServer, ETag, SecurityHeaders, LoopbackGuard, CORS, Recovery, Logger, REDMetrics, MetricsEndpoint, RateLimit, RBAC permissions, RequireTenant, and SSE) while pulling zero Gin, pgx, or OpenTelemetry dependencies — ideal for stdlib net/http BFFs and desktop binaries. |
|
Package httputil provides standardized JSON API response helpers (OK, Created, NoContent, Error) and automatic translation from domain error types into client-safe HTTP error envelopes.
|
Package httputil provides standardized JSON API response helpers (OK, Created, NoContent, Error) and automatic translation from domain error types into client-safe HTTP error envelopes. |
|
Package idempotency provides two-phase atomic idempotency locking and response caching for HTTP mutating operations via the Idempotency-Key header, preventing duplicate side effects.
|
Package idempotency provides two-phase atomic idempotency locking and response caching for HTTP mutating operations via the Idempotency-Key header, preventing duplicate side effects. |
|
Package jwks provides an in-memory cached JSON Web Key Set (JWKS) resolver for cryptographic public keys, with automatic TTL refresh and resilient fallback.
|
Package jwks provides an in-memory cached JSON Web Key Set (JWKS) resolver for cryptographic public keys, with automatic TTL refresh and resilient fallback. |
|
Package logger provides context-aware structured JSON logging wrappers around the standard library log/slog package, propagating request IDs across service operations.
|
Package logger provides context-aware structured JSON logging wrappers around the standard library log/slog package, propagating request IDs across service operations. |
|
Package loopbackguard provides local-first loopback address validation, DNS-rebinding Host allowlisting, Sec-Fetch-Site / Origin Same-Origin checks, and constant-time per-boot ephemeral CSRF token verification for localhost BFFs and desktop Go services.
|
Package loopbackguard provides local-first loopback address validation, DNS-rebinding Host allowlisting, Sec-Fetch-Site / Origin Same-Origin checks, and constant-time per-boot ephemeral CSRF token verification for localhost BFFs and desktop Go services. |
|
Package maputil provides generic, zero-dependency helper functions for Go maps including Merge and Filter transformations.
|
Package maputil provides generic, zero-dependency helper functions for Go maps including Merge and Filter transformations. |
|
Package metrics defines framework-agnostic instrumentation interfaces (Counter, Gauge, Histogram) with zero-allocation no-op implementations, enabling pluggable metrics exporters without coupling core packages to specific monitoring backends.
|
Package metrics defines framework-agnostic instrumentation interfaces (Counter, Gauge, Histogram) with zero-allocation no-op implementations, enabling pluggable metrics exporters without coupling core packages to specific monitoring backends. |
|
Package pagination provides reusable helpers for offset-based pagination, clamping limit/page inputs to safe thresholds and computing SQL offsets and page totals.
|
Package pagination provides reusable helpers for offset-based pagination, clamping limit/page inputs to safe thresholds and computing SQL offsets and page totals. |
|
Package ratelimit provides in-memory IP-based rate limiting using TokenBucket and SlidingWindow algorithms, featuring background eviction to prevent memory leaks.
|
Package ratelimit provides in-memory IP-based rate limiting using TokenBucket and SlidingWindow algorithms, featuring background eviction to prevent memory leaks. |
|
Package rbac provides a domain-agnostic Role-Based Access Control (RBAC) engine supporting multi-segment wildcard pattern matching (e.g.
|
Package rbac provides a domain-agnostic Role-Based Access Control (RBAC) engine supporting multi-segment wildcard pattern matching (e.g. |
|
Package rbaccontext attaches and verifies RBAC permissions within standard context.Context, enabling fine-grained handler permission checks (Can, CanAny, CanAll).
|
Package rbaccontext attaches and verifies RBAC permissions within standard context.Context, enabling fine-grained handler permission checks (Can, CanAny, CanAll). |
|
Package recovery provides panic-trapping HTTP middleware with structured stack trace logging to slog and standardized client-safe JSON error responses via httputil.
|
Package recovery provides panic-trapping HTTP middleware with structured stack trace logging to slog and standardized client-safe JSON error responses via httputil. |
|
Package requestid provides HTTP middleware that injects or propagates canonical X-Request-ID correlation identifiers across request contexts and response headers.
|
Package requestid provides HTTP middleware that injects or propagates canonical X-Request-ID correlation identifiers across request contexts and response headers. |
|
Package retry provides context-aware retry execution with configurable backoff strategies (Constant, Linear, Exponential, ExponentialJitter) and error predicates.
|
Package retry provides context-aware retry execution with configurable backoff strategies (Constant, Linear, Exponential, ExponentialJitter) and error predicates. |
|
Package securityheaders provides HTTP middleware setting OWASP-recommended defensive headers (HSTS, CSP, X-Frame-Options, X-Content-Type-Options) and stripping server tokens.
|
Package securityheaders provides HTTP middleware setting OWASP-recommended defensive headers (HSTS, CSP, X-Frame-Options, X-Content-Type-Options) and stripping server tokens. |
|
Package shutdown provides coordinated graceful teardown management for microservices, intercepting OS termination signals and executing registered cleanup hooks concurrently within a strict timeout budget.
|
Package shutdown provides coordinated graceful teardown management for microservices, intercepting OS termination signals and executing registered cleanup hooks concurrently within a strict timeout budget. |
|
Package sliceutil provides generic, zero-dependency functional slice transformations including Reduce, GroupBy, Chunk, Unique, Flatten, and First.
|
Package sliceutil provides generic, zero-dependency functional slice transformations including Reduce, GroupBy, Chunk, Unique, Flatten, and First. |
|
Package sqlite provides a zero-dependency, driver-agnostic embedded SQLite WAL helper over database/sql with busy_timeout tuning, BEGIN IMMEDIATE write-serialized transactions, PRAGMA user_version schema migrations, WAL checkpointing, and atomic VACUUM INTO backups for desktop and edge Go services.
|
Package sqlite provides a zero-dependency, driver-agnostic embedded SQLite WAL helper over database/sql with busy_timeout tuning, BEGIN IMMEDIATE write-serialized transactions, PRAGMA user_version schema migrations, WAL checkpointing, and atomic VACUUM INTO backups for desktop and edge Go services. |
|
Package sse provides a first-class Server-Sent Events (text/event-stream) helper for AI token streaming, live background sync progress, and real-time SDUI delta updates with flushing, heartbeat keepalives, Last-Event-ID resumption, and clean context cancellation.
|
Package sse provides a first-class Server-Sent Events (text/event-stream) helper for AI token streaming, live background sync progress, and real-time SDUI delta updates with flushing, heartbeat keepalives, Last-Event-ID resumption, and clean context cancellation. |
|
Package stringutil provides domain-agnostic string utilities including sensitive PII masking (MaskEmail, MaskPhone) and cryptographically secure random string generation.
|
Package stringutil provides domain-agnostic string utilities including sensitive PII masking (MaskEmail, MaskPhone) and cryptographically secure random string generation. |
|
Package telemetry initializes OpenTelemetry tracing providers and propagators, providing process-global setup (InitProvider) and instance-scoped providers (NewTracerProvider) without global mutation, plus span creation helpers (StartSpan).
|
Package telemetry initializes OpenTelemetry tracing providers and propagators, providing process-global setup (InitProvider) and instance-scoped providers (NewTracerProvider) without global mutation, plus span creation helpers (StartSpan). |
|
Package timeutil provides domain-agnostic time helpers including UTC normalization, timezone conversions, and business day calculations.
|
Package timeutil provides domain-agnostic time helpers including UTC normalization, timezone conversions, and business day calculations. |
|
Package uuidutil provides domain-agnostic UUID generation, parsing, and validation helpers.
|
Package uuidutil provides domain-agnostic UUID generation, parsing, and validation helpers. |
|
Package validation provides helpers to transform and format go-playground/validator error structures into client-safe, uniform field-error JSON representations.
|
Package validation provides helpers to transform and format go-playground/validator error structures into client-safe, uniform field-error JSON representations. |
|
Package workerpool provides a bounded, panic-safe worker pool for concurrent background task execution, preventing unbounded goroutine growth under high-load spikes.
|
Package workerpool provides a bounded, panic-safe worker pool for concurrent background task execution, preventing unbounded goroutine growth under high-load spikes. |
Click to show internal directories.
Click to hide internal directories.
