Pagination
You can use:
package helper
type URLQueryPager struct {
// example = ?current_page=1&page_size=25
CurrentPage int `binding:"min=1" form:"current_page"`
PageSize int `binding:"min=1" form:"page_size"`
}
1
2
3
4
5
6
7
2
3
4
5
6
7
in your code that needs pagination like:
package mypackage
import "github.com/coretrix/hitrix/pkg/helper"
type SomeURLQuery struct {
helper.URLQueryPager
OtherField1 string `form:"other_field_1"`
OtherField2 int `form:"other_field_2"`
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9