Versions in this module Expand all Collapse all v0 v0.2.0 Sep 16, 2026 Changes in this version + var METHODS = []string + func BindJSON(r *http.Request, dst any) error + func CORS(config CORSConfig) func(http.Handler) http.Handler + func ContentTypeJson(next http.Handler) http.Handler + func GetCtx[T any](r *http.Request, key any) (T, bool) + func Gzip(next http.Handler) http.Handler + func Handle(handlers []MiddlewareFunc, handler http.Handler) http.Handler + func JSON(w http.ResponseWriter, code int, data any) + func MaxBodyBytes(limit int64) func(http.Handler) http.Handler + func Metrics(recorder *MetricsRecorder) func(http.Handler) http.Handler + func NewHttp(config ServerConfig) *httpServerImpl + func NewRouter(config RouterConfig) *routerImpl + func Params(r *http.Request) map[string]string + func Query(r *http.Request, key string) string + func QueryBool(r *http.Request, key string, defaultVal bool) bool + func QueryFloat(r *http.Request, key string, defaultVal float64) float64 + func QueryInt(r *http.Request, key string, defaultVal int) int + func RateLimiter(config RateLimiterConfig) func(http.Handler) http.Handler + func RecoverMiddleware(next http.Handler, stackTrace ...bool) http.Handler + func RemoteIP(r *http.Request) string + func RequestID(next http.Handler) http.Handler + func RequestLogger(next http.Handler, logger ...Logger) http.Handler + func SetCtx(r *http.Request, key, value any) *http.Request + func Text(w http.ResponseWriter, code int, msg string) + func URLParam(r *http.Request, key string) string + func WriteError(w http.ResponseWriter, code int, msg string) + type CORSConfig struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + ExposedHeaders []string + MaxAge int + type ContextKey string + const ParamsContextKey + type HttpRouter interface + Routes func(r RouteRegister) + type HttpServer interface + Start func(router http.Handler) error + Stop func(ctx context.Context) error + type LogLevel int + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelWarn + type Logger interface + Debugf func(format string, args ...any) + Errorf func(format string, args ...any) + Infof func(format string, args ...any) + Warnf func(format string, args ...any) + type MetricsRecorder struct + ActiveRequests atomic.Int64 + TotalDuration atomic.Int64 + TotalRequests atomic.Int64 + func (m *MetricsRecorder) Snapshot() map[string]any + type MiddlewareFunc = func(http.Handler) http.Handler + func WithContext(name string, value any) MiddlewareFunc + type Param struct + Key string + Value string + type RateLimiterConfig struct + Burst int + KeyFunc func(*http.Request) string + RequestsPerSecond int + type RouteInfo struct + Method string + Middlewares int + Pattern string + type RouteRegister interface + Group func(path string, args ...any) Router + Use func(args ...any) RouteRegister + type Router interface + Delete func(path string, args ...any) Router + Get func(path string, args ...any) Router + Head func(path string, args ...any) Router + Logger func() Logger + Mount func(path string, sub http.Handler) Router + Patch func(path string, args ...any) Router + Post func(path string, args ...any) Router + Put func(path string, args ...any) Router + type RouterAction = func(router Router) Router + type RouterConfig struct + AssetDir string + AssetPath string + BaseContext context.Context + FS fs.FS + LogLevel LogLevel + Logger Logger + MethodNotAllowedHandler http.Handler + NotFoundHandler http.Handler + type ServerConfig struct + Addr string + IdleTimeout time.Duration + ReadTimeout time.Duration + WriteTimeout time.Duration v0.1.1 Jul 27, 2026 v0.1.0 Jul 27, 2026