Debian Codegraph @

pkg/types/sender_options.go

raw
1 package types
2
3 import "time"
4
5 // SenderOptions controls creation of senders and routers.
6 //
7 // HTTPClient, if non-nil, will be used for all outbound HTTP requests
8 // made by the resulting sender/router. This allows callers to supply
9 // custom transports, dialers, TLS configuration, timeouts, etc.
10 //
11 // DialContext, if non-nil, will be used for outbound TCP connections
12 // made by services that implement [DialContextSetter]. Implementations
13 // must be safe for concurrent use. TLS wrapping remains the service's
14 // responsibility after the TCP dial. A nil value uses the service default.
15 //
16 // Timeout, if > 0, is the exact fixed timeout for every service on the sender.
17 // Zero leaves each service's own send budget in effect.
18 type SenderOptions struct {
19 // HTTPClient is the client used for all HTTP operations.
20 // If nil, a default client with reasonable settings is used.
21 HTTPClient HTTPClient
22
23 // DialContext is the dial function used for non-HTTP TCP connections.
24 // If nil, services use their default dialer.
25 DialContext DialContextFunc
26
27 // Timeout, when set, is the exact fixed timeout for every service on the sender.
28 // Zero leaves each service's own send budget in effect.
29 Timeout time.Duration
30 }