IMG-51: router -> server ns, handlers ns, added error to handler ret val (#1494)

* Introduced server, handlers, error ret in handlerfn

* Server struct with tests

* replace checkErr with return
This commit is contained in:
Victor Sokolov
2025-08-20 14:31:11 +02:00
committed by GitHub
parent 0ddefe1b85
commit 15bd00b221
29 changed files with 1483 additions and 561 deletions

View File

@@ -22,7 +22,7 @@ import (
"github.com/imgproxy/imgproxy/v3/imagedata"
"github.com/imgproxy/imgproxy/v3/imagetype"
"github.com/imgproxy/imgproxy/v3/options"
"github.com/imgproxy/imgproxy/v3/router"
"github.com/imgproxy/imgproxy/v3/server"
"github.com/imgproxy/imgproxy/v3/svg"
"github.com/imgproxy/imgproxy/v3/testutil"
"github.com/imgproxy/imgproxy/v3/vips"
@@ -31,7 +31,7 @@ import (
type ProcessingHandlerTestSuite struct {
suite.Suite
router *router.Router
router *server.Router
}
func (s *ProcessingHandlerTestSuite) SetupSuite() {
@@ -48,7 +48,7 @@ func (s *ProcessingHandlerTestSuite) SetupSuite() {
logrus.SetOutput(io.Discard)
s.router = buildRouter()
s.router = buildRouter(server.NewRouter(server.NewConfigFromEnv()))
}
func (s *ProcessingHandlerTestSuite) TeardownSuite() {