mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 05:25:58 +00:00
add a new 'uuid' path parameter type e.g. /{id:uuid}
This commit is contained in:
16
HISTORY.md
16
HISTORY.md
@@ -28,6 +28,22 @@ The codebase for Dependency Injection, Internationalization and localization and
|
||||
|
||||
## Fixes and Improvements
|
||||
|
||||
- New `uuid` builtin path parameter type. Example:
|
||||
|
||||
```go
|
||||
// +------------------------+
|
||||
// | {param:uuid} |
|
||||
// +------------------------+
|
||||
// UUIDv4 (and v1) path parameter validation.
|
||||
|
||||
// http://localhost:8080/user/bb4f33e4-dc08-40d8-9f2b-e8b2bb615c0e -> OK
|
||||
// http://localhost:8080/user/dsadsa-invalid-uuid -> NOT FOUND
|
||||
app.Get("/user/{id:uuid}", func(ctx iris.Context) {
|
||||
id := ctx.Params().Get("id")
|
||||
ctx.WriteString(id)
|
||||
})
|
||||
```
|
||||
|
||||
- New `Configuration.KeepAlive` and `iris.WithKeepAlive(time.Duration) Configurator` added as helpers to start the server using a tcp listener featured with keep-alive.
|
||||
|
||||
- New `DirOptions.ShowHidden bool` is added by [@tuhao1020](https://github.com/tuhao1020) at [PR #1717](https://github.com/kataras/iris/pull/1717) to show or hide the hidden files when `ShowList` is set to true.
|
||||
|
||||
Reference in New Issue
Block a user