MCPcopy Create free account
hub / github.com/DoNewsCode/core / WithClientConstructor

Function WithClientConstructor

otes/dependency_option.go:25–29  ·  view source on GitHub ↗

WithClientConstructor instructs the Providers to accept an alternative constructor for elasticsearch client. Refer to the package elastic for how to construct a custom elastic.Client.

(f func(ClientArgs) (*elastic.Client, error))

Source from the content-addressed store, hash-verified

23// WithClientConstructor instructs the Providers to accept an alternative constructor for elasticsearch client.
24// Refer to the package elastic for how to construct a custom elastic.Client.
25func WithClientConstructor(f func(ClientArgs) (*elastic.Client, error)) ProvidersOptionFunc {
26 return func(options *providersOption) {
27 options.clientConstructor = f
28 }
29}
30
31// WithReload toggles whether to reload the factory after receiving the OnReload
32// event. By default, the factory won't be reloaded.

Callers 1

Example_providersFunction · 0.92

Calls

no outgoing calls

Tested by 1

Example_providersFunction · 0.74