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, overrides the default per-service timeout.
17 type SenderOptions struct {
18 // HTTPClient is the client used for all HTTP operations.
19 // If nil, a default client with reasonable settings is used.
20 HTTPClient HTTPClient
21
22 // DialContext is the dial function used for non-HTTP TCP connections.
23 // If nil, services use their default dialer.
24 DialContext DialContextFunc
25
26 // Timeout overrides the default operation timeout when > 0.
27 Timeout time.Duration
28 }