1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

API versioning improvements

Replace the go-version package with a regex-free alternative semver

the result: versioned apis have almost zero performance cost now

thanks @motogo for your kind donation ❤️ - please check your github notifications
This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-07 04:14:41 +02:00
parent b409f7807e
commit 240fdb6dc3
21 changed files with 381 additions and 463 deletions

View File

@@ -164,7 +164,7 @@ func overlapRoute(r *Route, next *Route) {
// Version was not found:
// we need to be able to send the status on the last not found version
// but reset the status code if a next available matched version was found.
// see: versioning.Handler.
// see the versioning package.
if !errors.Is(ctx.GetErr(), context.ErrNotFound) {
ctx.StatusCode(prevStatusCode)
}
@@ -720,7 +720,7 @@ func (api *APIBuilder) Party(relativePath string, handlers ...context.Handler) P
copy(allowMethods, api.allowMethods)
// make a copy of the parent properties.
var properties map[string]interface{}
var properties context.Map
for k, v := range api.properties {
properties[k] = v
}