|
|
|
@ -54,20 +54,14 @@ func Must(ctx context.Context) *Components {
|
|
|
|
|
return c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New(components ...Component) *Components {
|
|
|
|
|
com := &Components{components: make(map[string]Component)}
|
|
|
|
|
func New(service micro.Service, components ...Component) *Components {
|
|
|
|
|
com := &Components{service: service, components: make(map[string]Component)}
|
|
|
|
|
|
|
|
|
|
com.Add(components...)
|
|
|
|
|
|
|
|
|
|
return com
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Components) SetService(service micro.Service) *Components {
|
|
|
|
|
c.service = service
|
|
|
|
|
|
|
|
|
|
return c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Components) Service() micro.Service {
|
|
|
|
|
return c.service
|
|
|
|
|
}
|
|
|
|
|