-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81ec7aa
commit c91e545
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# pagination | ||
|
||
-- | ||
import "github.com/VictorAvelar/mollie-api-go/v3/mollie/tools/pagination" | ||
|
||
Package pagination provides utilities to handle pagination in API responses. | ||
|
||
Pagination is a common feature in APIs that allows retrieval of large datasets | ||
in smaller chunks, enhancing performance and resource usage. This package aims | ||
to simplify pagination-related tasks by providing helpful functions. | ||
|
||
## Usage | ||
|
||
#### func ExtractFromQueryParam | ||
|
||
```go | ||
func ExtractFromQueryParam(uri string) (lastID string, err error) | ||
``` | ||
|
||
ExtractFromQueryParam extracts the lastID from the given URI, which is assumed | ||
to be a URL with query parameters. It specifically looks for a query parameter | ||
named 'from' and returns its value as a string. If the URI cannot be parsed or | ||
the query parameter is not found, it returns an empty string and the encountered | ||
error. |