1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-28 07:17:06 +00:00

i18n: expose the LoaderConfig from the main i18n instance and add an example

Signed-off-by: Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-10 05:17:03 +03:00
parent b77227a0f9
commit 777ef0cd3e
8 changed files with 134 additions and 23 deletions

View File

@@ -43,6 +43,13 @@ func Skip(ctx iris.Context) {
ctx.Values().Set(skipLogContextKey, struct{}{})
}
// SkipHandler same as `Skip` but it can be used
// as a middleware, it executes ctx.Next().
func SkipHandler(ctx iris.Context) {
Skip(ctx)
ctx.Next()
}
func shouldSkip(ctx iris.Context) bool {
return ctx.Values().Get(skipLogContextKey) != nil
}