From a0fc47de7198478191eed7641bca5fce260ad3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Thu, 22 Aug 2024 16:13:12 +0200 Subject: [PATCH] chore: add godocs --- internal/hooks/httpdump.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/hooks/httpdump.go b/internal/hooks/httpdump.go index 18d1840..5b6fa59 100644 --- a/internal/hooks/httpdump.go +++ b/internal/hooks/httpdump.go @@ -6,12 +6,14 @@ import ( "net/http/httputil" ) +// HTTPDumpRequestHook is a hook that dumps the request to stdout. type HTTPDumpRequestHook struct { Enabled bool } var _ beforeRequestHook = (*HTTPDumpRequestHook)(nil) +// BeforeRequest dumps the request to stdout if enabled. func (i *HTTPDumpRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error) { if !i.Enabled { return req, nil @@ -27,12 +29,14 @@ func (i *HTTPDumpRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *h return req, nil } +// HTTPDumpResponseHook is a hook that dumps the response to stdout. type HTTPDumpResponseHook struct { Enabled bool } var _ afterSuccessHook = (*HTTPDumpResponseHook)(nil) +// AfterSuccess dumps the response to stdout if enabled. func (i *HTTPDumpResponseHook) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error) { if !i.Enabled { return res, nil