|
|
|
@ -54,8 +54,8 @@ func Must(ctx context.Context) *Components {
|
|
|
|
|
return c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New(service micro.Service, components ...Component) *Components {
|
|
|
|
|
com := &Components{service: service, components: make(map[string]Component)}
|
|
|
|
|
func New(service micro.Service, flagPrefix string, components ...Component) *Components {
|
|
|
|
|
com := &Components{service: service, flagPrefix: flagPrefix, components: make(map[string]Component)}
|
|
|
|
|
|
|
|
|
|
com.Add(components...)
|
|
|
|
|
|
|
|
|
@ -66,12 +66,6 @@ func (c *Components) Service() micro.Service {
|
|
|
|
|
return c.service
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Components) SetFlagPrefix(flagPrefix string) *Components {
|
|
|
|
|
c.flagPrefix = flagPrefix
|
|
|
|
|
|
|
|
|
|
return c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Components) FlagPrefix() string {
|
|
|
|
|
return c.flagPrefix
|
|
|
|
|
}
|
|
|
|
|