22 lines
364 B
Go
22 lines
364 B
Go
package parsers
|
|
|
|
import (
|
|
"system-trace/core/types"
|
|
"system-trace/core/validators"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func GetPagination(c *fiber.Ctx) (*types.Pagination, error) {
|
|
p := new(types.Pagination)
|
|
if err := c.QueryParser(p); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if err := validators.Validate(c, p); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return p, nil
|
|
}
|