feat: chunk uploads

This commit is contained in:
Rogee
2025-01-15 00:26:10 +08:00
parent 591771ce77
commit 9bfdf0e0ea
16 changed files with 451 additions and 40 deletions

View File

@@ -1,10 +1,18 @@
package f
import (
"mime/multipart"
"github.com/gofiber/fiber/v3"
"github.com/pkg/errors"
)
func File(key string) func(fiber.Ctx) (*multipart.FileHeader, error) {
return func(ctx fiber.Ctx) (*multipart.FileHeader, error) {
return ctx.FormFile(key)
}
}
func Local[T any](key string) func(fiber.Ctx) (T, error) {
return func(ctx fiber.Ctx) (T, error) {
v := fiber.Locals[T](ctx, key)