Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for #1736 fluent binder #172

Merged
merged 4 commits into from
Feb 2, 2021
Merged

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Jan 2, 2021

Copy link
Contributor

@pafuent pafuent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR includes the docs of #169, so maybe this could be merged instead of it if the Fluent Binder PR gets merged soon

```

### Methods
`FailFast` flags binder to stop binding after first bind error during binder call chain. Enabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think FailFast should include the () to be consistent


* `<Type>("param", &destination)` - if parameter value exists then binds it to given destination of that type i.e `Int64(...)`.
* `Must<Type>("param", &destination)` - parameter value is required to exist, binds it to given destination of that type i.e `MustInt64(...)`.
* `<Type>s("param", &destination)` - (for slices) if parameter values exists then binds it to given destination of that type i.e `I`nt64s(...)`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here there is a extra ` after the I (`I`nt64s(...)`)

* `<Type>s("param", &destination)` - (for slices) if parameter values exists then binds it to given destination of that type i.e `I`nt64s(...)`.
* `Must<Type>s("param", &destination)` - (for slices) parameter value is required to exist, binds it to given destination of that type i.e `MustInt64s(...)`.

for some slice types `BindWithDelimiter("param", &dest, ",")` supports slitting parameter values before type conversion is done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo on slitting

@lammel
Copy link
Contributor

lammel commented Jan 31, 2021

@aldas @pafuent Maybe you can take a look on the doc updates.
Binding has been moved to it's own guide now and feedback from @pafuent is included.

Mention `UnixTimeNano()` as supported fluent binder function
@aldas
Copy link
Contributor Author

aldas commented Feb 1, 2021

lgtm. I added 2 little changes:

  • example was anonymous function (without name) so I added e.POST("/users", in front of example to be more familiar route definition.
  • mentioned UnixTimeNano() as supported fluent binder function

splitting binder to its own page is good move. It is easier to find it on site.

@pafuent pafuent merged commit d899094 into labstack:master Feb 2, 2021
@aldas aldas deleted the docs_1736_fluent_binder branch February 23, 2021 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants