Skip to content

Commit 4998229

Browse files
committed
chore: add godocs
1 parent c8cf795 commit 4998229

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/hooks/httpdump.go

+4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import (
66
"net/http/httputil"
77
)
88

9+
// HTTPDumpRequestHook is a hook that dumps the request to stdout.
910
type HTTPDumpRequestHook struct {
1011
Enabled bool
1112
}
1213

1314
var _ beforeRequestHook = (*HTTPDumpRequestHook)(nil)
1415

16+
// BeforeRequest dumps the request to stdout if enabled.
1517
func (i *HTTPDumpRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error) {
1618
if !i.Enabled {
1719
return req, nil
@@ -27,12 +29,14 @@ func (i *HTTPDumpRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *h
2729
return req, nil
2830
}
2931

32+
// HTTPDumpResponseHook is a hook that dumps the response to stdout.
3033
type HTTPDumpResponseHook struct {
3134
Enabled bool
3235
}
3336

3437
var _ afterSuccessHook = (*HTTPDumpResponseHook)(nil)
3538

39+
// AfterSuccess dumps the response to stdout if enabled.
3640
func (i *HTTPDumpResponseHook) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error) {
3741
if !i.Enabled {
3842
return res, nil

0 commit comments

Comments
 (0)