Skip to content

Commit

Permalink
Merge pull request #2 from enverbisevac/eb/pagination
Browse files Browse the repository at this point in the history
[MAINT] readme updated
  • Loading branch information
enverbisevac authored Oct 20, 2022
2 parents 954b46a + 7dd8961 commit 1e6368d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,27 @@ when we have data then we can render output:
pagination.Render(w, r, data)
```

Render output can be placed in headers or body of the request, default one is header,
this setting can be changed by package variable at init function of your project.
List of package variables can be set:

```go
var (
// PageParam is query name param for current page
PageParam = "page"
// PerPageParam is number of items per page
PerPageParam = "per_page"
// PerPageDefault sets default number of items on response
PerPageDefault = 25
// Linkf is format for Link headers
Linkf = `<%s>; rel="%s"`
// PaginationInHeader write pagination in header
PaginationInHeader = true
// PaginationBody generates pagination in body
PaginationBody = DefaultPaginationBody
)
```

### Other API functions

```go
Expand Down

0 comments on commit 1e6368d

Please sign in to comment.