mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-09 19:52:30 +02:00
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:
@@ -6,7 +6,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/vips"
|
||||
)
|
||||
|
||||
@@ -89,7 +89,7 @@ func (p pipeline) Run(ctx context.Context, img *vips.Image, po *options.Processi
|
||||
return err
|
||||
}
|
||||
|
||||
if err := router.CheckTimeout(ctx); err != nil {
|
||||
if err := server.CheckTimeout(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@@ -12,8 +12,8 @@ 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/security"
|
||||
"github.com/imgproxy/imgproxy/v3/server"
|
||||
"github.com/imgproxy/imgproxy/v3/svg"
|
||||
"github.com/imgproxy/imgproxy/v3/vips"
|
||||
)
|
||||
@@ -173,7 +173,7 @@ func transformAnimated(ctx context.Context, img *vips.Image, po *options.Process
|
||||
return err
|
||||
}
|
||||
|
||||
if err = router.CheckTimeout(ctx); err != nil {
|
||||
if err = server.CheckTimeout(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func saveImageToFitBytes(ctx context.Context, po *options.ProcessingOptions, img
|
||||
}
|
||||
imgdata.Close()
|
||||
|
||||
if err := router.CheckTimeout(ctx); err != nil {
|
||||
if err := server.CheckTimeout(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user