examples

module
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT

Directories

Path Synopsis
Config is an example service demonstrating typed configuration getters, struct configuration and environment variable overrides via the config package.
Config is an example service demonstrating typed configuration getters, struct configuration and environment variable overrides via the config package.
Graceful is an example service demonstrating graceful shutdown with readiness probes and registered closers.
Graceful is an example service demonstrating graceful shutdown with readiness probes and registered closers.
Healthz is an example service demonstrating startup, readiness, liveness and always health probes.
Healthz is an example service demonstrating startup, readiness, liveness and always health probes.
handler
Package handler provides a logging health probe used by the healthz example.
Package handler provides a logging health probe used by the healthz example.
Job is an example demonstrating a run-to-completion job with sequential steps, a timeout and closers.
Job is an example demonstrating a run-to-completion job with sequential steps, a timeout and closers.
Logging is an example service demonstrating the log package helpers for errors, durations and HTTP requests, together with the zap log level service.
Logging is an example service demonstrating the log package helpers for errors, durations and HTTP requests, together with the zap log level service.
middlewares
basicauth command
Basicauth is an example service demonstrating the basic auth middleware.
Basicauth is an example service demonstrating the basic auth middleware.
cors command
Cors is an example service demonstrating the CORS middleware with allowed origins and methods.
Cors is an example service demonstrating the CORS middleware with allowed origins and methods.
jwtfromcookie command
Jwtfromcookie is an example service demonstrating the JWT middleware reading the token from a cookie, creating it when missing and updating its claims per path.
Jwtfromcookie is an example service demonstrating the JWT middleware reading the token from a cookie, creating it when missing and updating its claims per path.
jwtfromtoken command
Jwtfromtoken is an example service demonstrating the JWT middleware reading a required token from a custom header.
Jwtfromtoken is an example service demonstrating the JWT middleware reading a required token from a custom header.
logger command
Logger is an example service demonstrating the request logger middleware.
Logger is an example service demonstrating the request logger middleware.
recover command
Recover is an example service demonstrating the recover middleware handling panics.
Recover is an example service demonstrating the recover middleware handling panics.
requestid command
Requestid is an example service demonstrating the request ID middleware with a custom generator and response header.
Requestid is an example service demonstrating the request ID middleware with a custom generator and response header.
responsetime command
Responsetime is an example service demonstrating the response time middleware with a maximum duration.
Responsetime is an example service demonstrating the response time middleware with a maximum duration.
sessionid command
Sessionid is an example service demonstrating the session ID middleware with a custom cookie, time provider and domain provider.
Sessionid is an example service demonstrating the session ID middleware with a custom cookie, time provider and domain provider.
skip command
Skip is an example service demonstrating the skip middleware with request URI blacklist and whitelist skippers.
Skip is an example service demonstrating the skip middleware with request URI blacklist and whitelist skippers.
telemetry command
Telemetry is an example service demonstrating the telemetry middleware with a stdout tracer and propagation header injection.
Telemetry is an example service demonstrating the telemetry middleware with a stdout tracer and propagation header injection.
tokenauthfromcookie command
Tokenauthfromcookie is an example service demonstrating the token auth middleware reading the token from a cookie.
Tokenauthfromcookie is an example service demonstrating the token auth middleware reading the token from a cookie.
tokenauthfromheader command
Tokenauthfromheader is an example service demonstrating the token auth middleware reading the token from a custom header.
Tokenauthfromheader is an example service demonstrating the token auth middleware reading the token from a custom header.
persistence
mongo command
Mongo is an example service demonstrating the MongoDB persistor with indexes, a custom codec and versioned entities raising duplicate key and dirty write errors.
Mongo is an example service demonstrating the MongoDB persistor with indexes, a custom codec and versioned entities raising duplicate key and dirty write errors.
mongo/repository
Package repository provides the MongoDB repository used by the mongo persistence example.
Package repository provides the MongoDB repository used by the mongo persistence example.
mongo/store
Package store provides the entities, indexes and BSON codec used by the mongo persistence example.
Package store provides the entities, indexes and BSON codec used by the mongo persistence example.
postgres command
Postgres is an example service demonstrating the PostgreSQL persistor with an init statement and a simple repository.
Postgres is an example service demonstrating the PostgreSQL persistor with an init statement and a simple repository.
postgres/repository
Package repository provides the task repository used by the postgres persistence example.
Package repository provides the task repository used by the postgres persistence example.
Remoteconfig is an example service demonstrating remote configuration from etcd and watching value changes.
Remoteconfig is an example service demonstrating remote configuration from etcd and watching value changes.
roundtripwares
logger command
Logger is an example demonstrating the logger roundtripware on an HTTP client.
Logger is an example demonstrating the logger roundtripware on an HTTP client.
requestid command
Requestid is an example service demonstrating the request, session and tracking ID roundtripwares propagating IDs to an internal request.
Requestid is an example service demonstrating the request, session and tracking ID roundtripwares propagating IDs to an internal request.
retry command
Retry is an example demonstrating the retry roundtripware against a server that fails the first requests with 503.
Retry is an example demonstrating the retry roundtripware against a server that fails the first requests with 503.
Serviceenabler is an example service demonstrating a service that is started and stopped at runtime through a config value.
Serviceenabler is an example service demonstrating a service that is started and stopped at runtime through a config value.
Services is an example demonstrating the built-in zap, viper, prometheus and pprof services.
Services is an example demonstrating the built-in zap, viper, prometheus and pprof services.
stream
jetstream command
Jetstream is an example service demonstrating publishing and subscribing to typed messages with the NATS JetStream stream.
Jetstream is an example service demonstrating publishing and subscribing to typed messages with the NATS JetStream stream.
jetstreamraw command
Jetstreamraw is an example service demonstrating raw publishing and subscribing through the underlying NATS JetStream context.
Jetstreamraw is an example service demonstrating raw publishing and subscribing through the underlying NATS JetStream context.
Telemetry is an example service demonstrating OpenTelemetry counters, up down counters and histograms alongside Prometheus exemplars, configured via OTEL_* env vars.
Telemetry is an example service demonstrating OpenTelemetry counters, up down counters and histograms alongside Prometheus exemplars, configured via OTEL_* env vars.

Jump to

Keyboard shortcuts

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