package httptrace
Import Path
net/http/httptrace (on golang.org and go.dev)
Dependency Relation
imports 7 packages, and imported by one package
Involved Source Files
d-> trace.go
Exported Type Names
type ClientTrace (struct)
ClientTrace is a set of hooks to run at various stages of an outgoing
HTTP request. Any particular hook may be nil. Functions may be
called concurrently from different goroutines and some may be called
after the request has completed or failed.
ClientTrace currently traces a single HTTP request & response
during a single round trip and has no hooks that span a series
of redirected requests.
See https://blog.golang.org/http-tracing for more.
ConnectDone func(network, addr string, err error)
ConnectStart func(network, addr string)
DNSDone func(DNSDoneInfo)
DNSStart func(DNSStartInfo)
GetConn func(hostPort string)
Got100Continue func()
Got1xxResponse func(code int, header textproto.MIMEHeader) error
GotConn func(GotConnInfo)
GotFirstResponseByte func()
PutIdleConn func(err error)
TLSHandshakeDone func(tls.ConnectionState, error)
TLSHandshakeStart func()
Wait100Continue func()
WroteHeaderField func(key string, value []string)
WroteHeaders func()
WroteRequest func(WroteRequestInfo)
func ContextClientTrace(ctx context.Context) *ClientTrace
func WithClientTrace(ctx context.Context, trace *ClientTrace) context.Context
type DNSDoneInfo (struct)
DNSDoneInfo contains information about the results of a DNS lookup.
Addrs []net.IPAddr
Coalesced bool
Err error
type DNSStartInfo (struct)
DNSStartInfo contains information about a DNS request.
Host string
type GotConnInfo (struct)
GotConnInfo is the argument to the ClientTrace.GotConn function and
contains information about the obtained connection.
Conn net.Conn
IdleTime time.Duration
Reused bool
WasIdle bool
type WroteRequestInfo (struct)
WroteRequestInfo contains information provided to the WroteRequest
hook.
Err error
Exported Values
func ContextClientTrace(ctx context.Context) *ClientTrace
ContextClientTrace returns the ClientTrace associated with the
provided context. If none, it returns nil.
func WithClientTrace(ctx context.Context, trace *ClientTrace) context.Context
WithClientTrace returns a new context based on the provided parent
ctx. HTTP client requests made with the returned context will use
the provided trace hooks, in addition to any previous hooks
registered with ctx. Any hooks defined in the provided trace will
be called first.
![]() |
The pages are generated with Golds v0.1.6. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project and developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |