MCPcopy Create free account
hub / github.com/golobby/container / Transient

Method Transient

container.go:170–172  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

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.
170func (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.

Calls 1

bindMethod · 0.95