Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterWithGroup ¶
RegisterWithGroup registers a constructor with a group name and type. This is useful for grouping constructors together.
Parameters:
- groupCreation: the constructor to register. This should be a function that returns an instance of the group type given in the groupType parameter.
- groupName: the name of the group to register the constructor with.
- groupType: the type of the group to register the constructor with. This should be an interface type.
Returns:
- the constructor annotated with the group name and type.
Example:
fx.Provide( ioc.RegisterWithGroup(NewGroup, "my-group", new(MyGroup)), )
func RegisterWithName ¶
RegisterWithName registers a constructor with a name and parameters. This is useful for providing multiple instances of the same type.
Parameters:
- constructor: The constructor to register, should be a function that returns an instance of the type to register.
- name: The unique name used to register with container.
Returns:
- the constructor annotated with the name and parameters.
Example:
fx.Provide( ioc.RegisterWithName(NewService, "service1"), ioc.RegisterWithName(NewService, "service2"), )
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.