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

Function WithClientConstructor

clihttp/dependency_option.go:20–24  ·  view source on GitHub ↗

WithClientConstructor instructs the Providers to accept an alternative constructor for the contract.HttpDoer to be wrapped by clihttp.NewClient.

(f func(args ClientArgs) (contract.HttpDoer, error))

Source from the content-addressed store, hash-verified

18// WithClientConstructor instructs the Providers to accept an alternative
19// constructor for the contract.HttpDoer to be wrapped by clihttp.NewClient.
20func WithClientConstructor(f func(args ClientArgs) (contract.HttpDoer, error)) ProvidersOptionFunc {
21 return func(options *providersOption) {
22 options.clientConstructor = f
23 }
24}
25
26// WithClientOption instructs the Providers to accept additional options for the
27// NewClient call, such as WithRequestLogThreshold.

Callers 1

TestProvidersFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestProvidersFunction · 0.74