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:
@@ -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
|
||||
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user