Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is the service container for dependency injection.
func (*Container) Bind ¶
Bind registers a factory function for a service. Each Make() call invokes the factory and returns a new instance (transient).
type Factory ¶
type Factory func(c *Container) interface{}
Factory is a function that creates a service instance.
type Provider ¶
type Provider interface {
// Register binds services into the container.
// Called before the application boots. Only register bindings here.
Register(c *Container)
// Boot runs after ALL providers have been registered.
// May resolve other services from the container.
Boot(c *Container)
}
Provider defines the lifecycle hooks for service registration.
Click to show internal directories.
Click to hide internal directories.