Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test4 #12

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
go:
version: 0.0.4
version: 0.0.5
additionalDependencies:
k8s.io/apimachinery: v0.30.2
allowUnknownFieldsInWeakUnions: false
Expand Down
4 changes: 4 additions & 0 deletions internal/hooks/httpdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading