Skip to content

Commit

Permalink
adding simple example
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelarte committed Nov 9, 2024
1 parent f340eb5 commit 9d1dd55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### TODO

- Use uint instead of int
- Add code coverage badge
- Check for fmt
- Add more examples

### Added
Expand Down
2 changes: 2 additions & 0 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type PageRequest interface {
IsUnPaged() bool
}

// PageRequestOf Creates a PageRequest with the page and size values
func PageRequestOf(page, size int) (PageRequest, error) {
if page < 0 {
return nil, ErrPageCantBeNegative
Expand All @@ -36,6 +37,7 @@ func PageRequestOf(page, size int) (PageRequest, error) {
return &internal.PageRequestImpl{Page: page, Size: size}, nil
}

// UnPaged Create an unpaged request (no pagination is applied)
func UnPaged() PageRequest {
return &internal.PageRequestImpl{Page: 0, Size: 0}
}

0 comments on commit 9d1dd55

Please sign in to comment.