* Providers returns a set of dependency providers. It includes the Maker, the default *elastic.Client and exported configs. Depends On: log.Logger contract.ConfigAccessor opentracing.Tracer `optional:"true"` contract.Dispatcher `optional:"true"` contract.DIPopulator Provides: Fa
(opts ...ProvidersOptionFunc)
| 28 | *elastic.Client |
| 29 | */ |
| 30 | func Providers(opts ...ProvidersOptionFunc) di.Deps { |
| 31 | options := providersOption{ |
| 32 | interceptor: func(name string, opt *Config) {}, |
| 33 | clientConstructor: newClient, |
| 34 | } |
| 35 | for _, f := range opts { |
| 36 | f(&options) |
| 37 | } |
| 38 | return di.Deps{ |
| 39 | provideEsFactory(&options), |
| 40 | provideDefaultClient, |
| 41 | provideConfig, |
| 42 | di.Bind(new(Factory), new(Maker)), |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // EsConfigInterceptor is an injector type hint that allows user to do |
| 47 | // last minute modification to es configurations. |