feat: add optional http server config params

This commit is contained in:
Levente Nas
2025-09-15 13:04:21 -04:00
parent 3d413a8605
commit 48c0be51dc
3 changed files with 46 additions and 10 deletions

View File

@@ -1,6 +1,9 @@
package SimpleRouter
import "net/http"
import (
"net/http"
"time"
)
type Middleware func(http.Handler) http.Handler
@@ -10,3 +13,9 @@ type RouteGroup struct {
middlewares []Middleware // Stack of middlewares that will be applied on a handler in order
global_middlewares *[]Middleware
}
type ServerConfig struct {
ReadTimeout time.Duration
ReadHeaderTimeout time.Duration
WriteTimeout time.Duration
}