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

chore: add godocs #13

Merged
merged 4 commits into from
Aug 22, 2024
Merged
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 .github/workflows/generate_on_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
uses: EndBug/add-and-commit@v9
with:
add: .
default_author: github_actions
default_author: github_actor
message: Update provider based on openapi.yaml changes
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# .gitignore
bin/
8 changes: 4 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: b81e5def-5b1e-4753-ae7c-0efccc2e6f61
management:
docChecksum: ec4d3cb9876f69aa90a3374c55d5aae7
docVersion: 0.0.1
speakeasyVersion: 1.377.2
generationVersion: 2.404.1
releaseVersion: 0.0.2
configChecksum: 59d52ed6401d8c1950ccdb31c5a49e44
speakeasyVersion: 1.377.3
generationVersion: 2.404.2
releaseVersion: 0.0.5
configChecksum: 3f4c19c5da9a7de794abfa0f86cede9e
features:
go:
additionalDependencies: 0.1.0
Expand Down
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ generate.sdk:
$(SED) -i 's#\(type RouteInput struct\)#// $(KUBEBUILDER_GENERATE_CODE_MARKER)\n\1#g' \
models/components/route.go

go mod tidy
$(MAKE) generate.deepcopy
git checkout -- $(OPENAPI_FILE) \
$(shell git ls-files models/components/route*.go) \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/Kong/sdk-konnect-go
go 1.20

require (
github.com/cenkalti/backoff/v4 v4.3.0
github.com/cenkalti/backoff/v4 v4.2.0
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw=
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ=
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
6 changes: 3 additions & 3 deletions sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ func New(opts ...SDKOption) *SDK {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "0.0.1",
SDKVersion: "0.0.2",
GenVersion: "2.404.1",
UserAgent: "speakeasy-sdk/go 0.0.2 2.404.1 0.0.1 github.com/Kong/sdk-konnect-go",
SDKVersion: "0.0.5",
GenVersion: "2.404.2",
UserAgent: "speakeasy-sdk/go 0.0.5 2.404.2 0.0.1 github.com/Kong/sdk-konnect-go",
Hooks: hooks.New(),
},
}
Expand Down