Versions in this module Expand all Collapse all v2 v2.0.1 Feb 2, 2026 Changes in this version + func HardenedServer(addr string, handler http.Handler, opts ...ServerOption) *http.Server + func MountSystemEndpoints(r ports.HTTPRouter, se SystemEndpoints) + func NewDefaultRouter(log ports.Logger) (ports.HTTPRouter, error) + func NewMigrator(dsn, table string, lockKey int64, allowDown bool, log ports.Logger, ...) (ports.Migrator, error) + func NewMigratorWithContext(ctx context.Context, dsn, table string, lockKey int64, allowDown bool, ...) (ports.Migrator, error) + func OpenAndPingDB(ctx context.Context, dsn string, timeout time.Duration) (ports.DatabasePool, error) + func OpenPoolOrExit(ctx context.Context, dsn string, timeout time.Duration, log ports.Logger) ports.DatabasePool + func RunDown(ctx context.Context, m ports.Migrator, dir string) error + func RunMigrationsOrExit(ctx context.Context, cfg config.Config, log ports.Logger, embedded []fs.FS) + func RunUp(ctx context.Context, m ports.Migrator, dir string) error + func StartServer(ctx context.Context, addr string, handler http.Handler, log ports.Logger) error + func StartServerOrExit(ctx context.Context, addr string, handler http.Handler, log ports.Logger) + func Status(ctx context.Context, m ports.Migrator, dir string) (string, error) + func WithTimeout(parent context.Context, d time.Duration) (context.Context, context.CancelFunc) + type Profile struct + Middlewares []func(http.Handler) http.Handler + ServerOptions []ServerOption + func ProfileDev(log ports.Logger, opts ...ProfileOption) (Profile, error) + func ProfileStrictAPI(log ports.Logger, opts ...ProfileOption) (Profile, error) + func (p Profile) Apply(r ports.HTTPRouter) + type ProfileOption func(*profileConfig) + func WithCORSOptions(opts ports.CORSOptions) ProfileOption + func WithIdentityResolver(resolver identity.Resolver) ProfileOption + func WithJSONStrict(strict bool) ProfileOption + func WithMaxBodyBytes(n int64) ProfileOption + func WithMetricsRecorder(rec metricsmw.MetricsRecorder) ProfileOption + func WithOTelOptions(opts oteltrace.Options) ProfileOption + func WithRateLimitDisabled() ProfileOption + func WithRateLimitOptions(opts rateln.Options) ProfileOption + func WithRequestLogOptions(opts ...requestlog.Option) ProfileOption + func WithRequestTimeout(d time.Duration) ProfileOption + func WithSecureOptions(opts ...securemw.Option) ProfileOption + type ServerOption func(*http.Server) + func WithIdleTimeout(d time.Duration) ServerOption + func WithMaxHeaderBytes(n int) ServerOption + func WithReadHeaderTimeout(d time.Duration) ServerOption + func WithReadTimeout(d time.Duration) ServerOption + func WithWriteTimeout(d time.Duration) ServerOption + type SystemEndpoints struct + Docs *docs.Handler + Health *health.Handler + Metrics http.Handler + Pprof http.Handler + Version *version.Handler