Documentation
¶
Index ¶
- func CanonicalHeaderMap(headers map[string]string) map[string]string
- func CanonicalHeaders(h http.Header) map[string]string
- func DecodeResponseBody(raw []byte, headers map[string]string) any
- func FastHTTPMiddleware(monitor *Monitor) func(fasthttp.RequestHandler) fasthttp.RequestHandler
- func GzipBatch(events []Event) ([]byte, error)
- func IsRetryableError(err error) bool
- func NetHTTPMiddleware(monitor *Monitor) func(http.Handler) http.Handler
- func ParseJSONBody(raw []byte) any
- func RedactValue(value any) any
- func Sign(secret, body []byte) string
- func ValidateConfig(projectKey, secretKey string) error
- func VersionHeaderValue() string
- type Config
- type Event
- type Monitor
- type ResponseCapture
- func (rw *ResponseCapture) EnsureStatus(code int)
- func (rw *ResponseCapture) Flush()
- func (rw *ResponseCapture) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (rw *ResponseCapture) StatusCode() int
- func (rw *ResponseCapture) Write(b []byte) (int, error)
- func (rw *ResponseCapture) WriteHeader(code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FastHTTPMiddleware ¶
func FastHTTPMiddleware(monitor *Monitor) func(fasthttp.RequestHandler) fasthttp.RequestHandler
func IsRetryableError ¶
func ParseJSONBody ¶
func RedactValue ¶
func ValidateConfig ¶
func VersionHeaderValue ¶
func VersionHeaderValue() string
Types ¶
type Config ¶
type Event ¶
type Event struct {
URL string `json:"url"`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
StatusCode int `json:"status_code"`
RequestHeaders map[string]string `json:"request_headers"`
RequestBody any `json:"request_body"`
ResponseHeaders map[string]string `json:"response_headers"`
ResponseBody any `json:"response_body"`
DurationMS int64 `json:"duration_ms"`
ClientIP string `json:"client_ip,omitempty"`
}
func RedactEvent ¶
type ResponseCapture ¶
type ResponseCapture struct {
http.ResponseWriter
// contains filtered or unexported fields
}
func NewResponseCapture ¶
func NewResponseCapture(w http.ResponseWriter) *ResponseCapture
func (*ResponseCapture) EnsureStatus ¶
func (rw *ResponseCapture) EnsureStatus(code int)
func (*ResponseCapture) Flush ¶
func (rw *ResponseCapture) Flush()
func (*ResponseCapture) Hijack ¶
func (rw *ResponseCapture) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*ResponseCapture) StatusCode ¶
func (rw *ResponseCapture) StatusCode() int
func (*ResponseCapture) WriteHeader ¶
func (rw *ResponseCapture) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.