Added explanation about the binder

This commit is contained in:
konrad 2018-12-01 00:10:59 +01:00
parent ec954ac350
commit 50ffad2e46
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,7 @@ implementations thus leading to much flexibility.
* [Search](#search)
* [Standard web handler](#standard-web-handler)
* [Errors](#errors)
* [URL param binder](#how-the-url-param-binder-works)
## Installation
@ -189,3 +190,10 @@ type HTTPError struct {
}
```
## How the url param binder works
The binder binds all values inside the url to their respective fields in a struct. Those fields need to have a tag
"param" with the name of the url placeholder which must be the same as in routes.
Whenever one of the standard CRUD methods is invoked, this binder is called, which enables one handler method
to handle all kinds of different urls with different parameters.