Documentation ¶
Overview ¶
Package agenthttp creates standard Go [net/http.Client]s with common config options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
func Do(l logger.Logger, client *http.Client, req *http.Request, opts ...DoOption) (*http.Response, error)
Do wraps the http.Client's Do method with debug logging and tracing options.
func NewClient ¶
func NewClient(opts ...ClientOption) *http.Client
NewClient creates a HTTP client. Note that the default timeout is 60 seconds; for some use cases (e.g. artifact operations) use WithNoTimeout.
func WithNoTimeout ¶ added in v3.83.1
func WithNoTimeout(c *clientConfig)
Types ¶
type ClientOption ¶
type ClientOption = func(*clientConfig)
func WithAllowHTTP2 ¶
func WithAllowHTTP2(a bool) ClientOption
func WithAuthToken ¶
func WithAuthToken(t string) ClientOption
func WithTLSConfig ¶
func WithTLSConfig(t *tls.Config) ClientOption
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOption
Click to show internal directories.
Click to hide internal directories.