Documentation ¶
Overview ¶
Package trace implement structured logging of requests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option is a functional option setter for Tracer.
func ErrorHandler ¶
func ErrorHandler(h utils.ErrorHandler) Option
ErrorHandler is a functional argument that sets error handler of the server.
func RequestHeaders ¶
RequestHeaders adds request headers to capture.
func ResponseHeaders ¶
ResponseHeaders adds response headers to capture.
type Request ¶
type Request struct { Method string `json:"method"` // Method - request method BodyBytes int64 `json:"body_bytes"` // BodyBytes - size of request body in bytes URL string `json:"url"` // URL - Request URL Headers http.Header `json:"headers,omitempty"` // Headers - optional request headers, will be recorded if configured TLS *TLS `json:"tls,omitempty"` // TLS - optional TLS record, will be recorded if it's a TLS connection }
Request contains information about an HTTP request.
type Response ¶
type Response struct { Code int `json:"code"` // Code - response status code Roundtrip float64 `json:"roundtrip"` // Roundtrip - round trip time in milliseconds Headers http.Header `json:"headers,omitempty"` // Headers - optional headers, will be recorded if configured BodyBytes int64 `json:"body_bytes"` // BodyBytes - size of response body in bytes }
Response contains information about HTTP response.
type TLS ¶
type TLS struct { Version string `json:"version"` // Version - TLS version Resume bool `json:"resume"` // Resume tells if the session has been re-used (session tickets) CipherSuite string `json:"cipher_suite"` // CipherSuite contains cipher suite used for this connection Server string `json:"server"` // Server contains server name used in SNI }
TLS contains information about this TLS connection.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer records request and response emitting JSON structured data to the output.
Click to show internal directories.
Click to hide internal directories.