Documentation
¶
Overview ¶
Package container is a lightweight yet powerful IoC container for Go projects. It provides an easy-to-use interface and performance-in-mind container to be your ultimate requirement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
Container is the repository of bindings
func (Container) Make ¶
Make will resolve the dependency and return a appropriate concrete of the given abstraction. It can take an abstraction (interface reference) and fill it with the related implementation. It also can takes a function (receiver) with one or more arguments of the abstractions (interfaces) that need to be resolved, Container will invoke the receiver function and pass the related implementations.
func (Container) Reset ¶
func (c Container) Reset()
Reset will reset the container and remove all the existing bindings.
func (Container) Singleton ¶
Singleton will bind an abstraction to a concrete for further singleton resolves. It takes a resolver function which returns the concrete and its return type matches the abstraction (interface). The resolver function can have arguments of abstraction that have bound already in Container.
func (Container) Transient ¶
Transient will bind an abstraction to a concrete for further transient resolves. It takes a resolver function which returns the concrete and its return type matches the abstraction (interface). The resolver function can have arguments of abstraction that have bound already in Container.