From bc4e5e6e755e0f6c2cdced1c5abc1cc50528946e 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 1/4] 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 From 84f600475b6cbeb39a6e18905e6e0e950c0e3c7c Mon Sep 17 00:00:00 2001 From: pmalek Date: Thu, 22 Aug 2024 15:11:19 +0000 Subject: [PATCH 2/4] Bump .speakeasy/gen.yaml based on label --- .speakeasy/gen.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ae556a7..b3ed091 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -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 From 6bc28d85903ac0908f9b643263cef5886897c545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Thu, 22 Aug 2024 17:29:43 +0200 Subject: [PATCH 3/4] ci: go mod tidy --- .github/workflows/generate_on_pr.yaml | 2 +- .gitignore | 1 + .speakeasy/gen.lock | 8 ++++---- Makefile | 1 + go.mod | 7 +++++-- go.sum | 4 ++-- sdk.go | 6 +++--- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generate_on_pr.yaml b/.github/workflows/generate_on_pr.yaml index 654e403..bad6987 100644 --- a/.github/workflows/generate_on_pr.yaml +++ b/.github/workflows/generate_on_pr.yaml @@ -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 diff --git a/.gitignore b/.gitignore index d3c2f59..3330282 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ # .gitignore +bin/ diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b7e0c4b..36ef3bb 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -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 diff --git a/Makefile b/Makefile index add04a9..b453b36 100644 --- a/Makefile +++ b/Makefile @@ -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) \ diff --git a/go.mod b/go.mod index a6f42fb..02cafc7 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,11 @@ + module github.com/Kong/sdk-konnect-go go 1.20 require ( - github.com/cenkalti/backoff/v4 v4.3.0 - github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 + github.com/cenkalti/backoff/v4 v4.2.0 + github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 + github.com/spyzhov/ajson v0.8.0 + k8s.io/apimachinery v0.30.2 ) diff --git a/go.sum b/go.sum index f804a4f..f955779 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/sdk.go b/sdk.go index 98dfbd5..c5d756b 100644 --- a/sdk.go +++ b/sdk.go @@ -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(), }, } From d5c9355fd168bfb0896eae082068911fbff95a7b Mon Sep 17 00:00:00 2001 From: pmalek Date: Thu, 22 Aug 2024 15:42:06 +0000 Subject: [PATCH 4/4] Update provider based on openapi.yaml changes --- go.mod | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 02cafc7..aa715cd 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,8 @@ - module github.com/Kong/sdk-konnect-go go 1.20 require ( github.com/cenkalti/backoff/v4 v4.2.0 - github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 - github.com/spyzhov/ajson v0.8.0 - k8s.io/apimachinery v0.30.2 + github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 )