mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +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:
@@ -347,6 +347,17 @@ func getBindingsForStruct(v reflect.Value, dependencies []*Dependency, markExpor
|
||||
return
|
||||
}
|
||||
|
||||
func getStaticInputs(bindings []*binding, numIn int) []reflect.Value {
|
||||
inputs := make([]reflect.Value, numIn)
|
||||
for _, b := range bindings {
|
||||
if d := b.Dependency; d != nil && d.Static {
|
||||
inputs[b.Input.Index], _ = d.Handle(nil, nil)
|
||||
}
|
||||
}
|
||||
|
||||
return inputs
|
||||
}
|
||||
|
||||
/*
|
||||
Builtin dynamic bindings.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user