Transient binds an abstraction to concrete in transient mode. It takes a resolver function that returns the concrete, and its return type matches the abstraction (interface). The resolver function can have arguments of abstraction that have been declared in the Container already.
(resolver interface{})
| 168 | // It takes a resolver function that returns the concrete, and its return type matches the abstraction (interface). |
| 169 | // The resolver function can have arguments of abstraction that have been declared in the Container already. |
| 170 | func (c Container) Transient(resolver interface{}) error { |
| 171 | return c.bind(resolver, "", false, false) |
| 172 | } |
| 173 | |
| 174 | // TransientLazy binds an abstraction to concrete lazily in transient mode. |
| 175 | // Normally the resolver will be called during registration, but that is skipped in lazy mode. |