Skip to content

Commit

Permalink
docs: Generic helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
viccon committed May 7, 2024
1 parent 5f48967 commit 53060d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,15 @@ use `any` as the type:

However, if this data source has more than a handful of types, the type
conversions may quickly feel like too much boilerplate. If that is the case,
you can use any of package level functions that performs these conversions for
you:
you can use any of these package level functions:

- [`GetFetch`](https://pkg.go.dev/github.com/creativecreature/sturdyc#GetFetch)
- [`GetFetchBatch`](https://pkg.go.dev/github.com/creativecreature/sturdyc#GetFetchBatch)
- [`Passthrough`](https://pkg.go.dev/github.com/creativecreature/sturdyc#Passthrough)
- [`PassthroughBatch`](https://pkg.go.dev/github.com/creativecreature/sturdyc#PassthroughBatch)

If any of the conversions fail, you'll get a [`ErrInvalidType`](https://pkg.go.dev/github.com/creativecreature/sturdyc#pkg-variables) error.
They will perform the type conversions for you, and if any of them where to fail,
you'll get a [`ErrInvalidType`](https://pkg.go.dev/github.com/creativecreature/sturdyc#pkg-variables) error.

Below is an example of what an API client that uses these functions might look
like:
Expand Down

0 comments on commit 53060d2

Please sign in to comment.