1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-06 03:27:27 +00:00

dependency injection: func (...<T>) iris.Handler can be generated to a simple iris handler if <T> are static dependencies

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-06-10 21:16:00 +03:00
parent 8f9140b705
commit 96c2dec47f
6 changed files with 58 additions and 7 deletions

View File

@@ -933,7 +933,7 @@ type (
// }
// Usage with (static) dependencies:
// app.RegisterDependency(userRepo, ...)
// app.PartyConfigure("/users", &api.UsersAPI{})
// app.PartyConfigure("/users", new(api.UsersAPI))
func (api *APIBuilder) PartyConfigure(relativePath string, partyReg ...PartyConfigurator) Party {
var child Party

View File

@@ -1059,12 +1059,10 @@ func cacheFiles(ctx stdContext.Context, fs http.FileSystem, names []string, comp
// so, unless requested keep it as it's.
buf := new(bytes.Buffer)
for _, alg := range compressAlgs {
// stop all compressions if at least one file failed to.
select {
case <-ctx.Done():
return ctx.Err()
return ctx.Err() // stop all compressions if at least one file failed to.
default:
break // lint:ignore
}
if alg == "brotli" {