feat: add optional http server config params

This commit was merged in pull request #11.
This commit is contained in:
Levente Nas
2025-09-15 13:04:21 -04:00
committed by Levente Batuska
parent 3d413a8605
commit a25edc65b7
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
}