annotation.go 982 B

1234567891011121314151617181920212223242526
  1. package di
  2. type Annotated struct {
  3. // If specified, this will be used as the name for all non-error values returned
  4. // by the constructor. For more information on named values, see the documentation
  5. // for the fx.Out type.
  6. //
  7. // A name option may not be provided if a group option is provided.
  8. Name string
  9. // If specified, this will be used as the group name for all non-error values returned
  10. // by the constructor. For more information on value groups, see the package documentation.
  11. //
  12. // A group option may not be provided if a name option is provided.
  13. //
  14. // Similar to group tags, the group name may be followed by a `,flatten`
  15. // option to indicate that each element in the slice returned by the
  16. // constructor should be injected into the value group individually.
  17. Group string
  18. // Target is the constructor or value being annotated with fx.Annotated.
  19. Target interface{}
  20. // Close is the function being closed when container is destroy
  21. Close interface{}
  22. }