https://github.com/ilgooz/paging
Pagination Utils for Go
https://github.com/ilgooz/paging
Last synced: about 2 months ago
JSON representation
Pagination Utils for Go
- Host: GitHub
- URL: https://github.com/ilgooz/paging
- Owner: ilgooz
- Created: 2015-09-18T13:18:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-05T03:52:13.000Z (over 9 years ago)
- Last Synced: 2025-01-31T13:22:38.226Z (4 months ago)
- Language: Go
- Homepage: https://godoc.org/github.com/ilgooz/paging
- Size: 141 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### paging [](http://godoc.org/github.com/ilgooz/paging)
> Simple pagination calculation util for Go## Example
```go
func main(){
var page, limit, itemsCount = 2, 3, 5p := paging.Paging{
Page: page,
Limit: limit,
Count: itemsCount,
}.Calc()fmt.Println(p.Limit, p.Offset, p.Page, p.TotalPages) // 3, 3, 2, 2
}
```