diff --git a/Dockerfile b/Dockerfile index 7a080a48..318f8fad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23-alpine3.20 as protoc-builder +FROM golang:1.23-alpine3.20 AS protoc-builder ENV PROTOC_VERSION=28.2 ARG TARGETARCH diff --git a/cmd/rest.go b/cmd/rest.go index 58f156c2..9fec4a3f 100644 --- a/cmd/rest.go +++ b/cmd/rest.go @@ -57,5 +57,12 @@ func restServe(ctx context.Context, builder *deps.Builder) error { } func init() { + restCmd.Flags().StringVarP( + &stubFlag, + "stub", + "s", + "", + "Path where the stub files are (Optional)") + rootCmd.AddCommand(restCmd) } diff --git a/example/simple/stub/errors.yml b/example/simple/stub/errors.yml index c2514e40..cfff6b6c 100644 --- a/example/simple/stub/errors.yml +++ b/example/simple/stub/errors.yml @@ -6,7 +6,8 @@ name: error output: error: test_error -- service: Gripmock +- id: 1d469bdf-c088-464f-8b87-4c1b5da2bd4d + service: Gripmock method: SayHello input: equals: diff --git a/go.mod b/go.mod index f5c8e1b5..0b041df0 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,14 @@ require ( github.com/bavix/features v1.0.0 github.com/bavix/gripmock-sdk-go v1.0.5 github.com/bavix/gripmock-ui v1.0.0-alpha9 - github.com/bavix/gripmock/protogen v0.0.0-20240924151019-bd43d64ad313 + github.com/bavix/gripmock/protogen v0.0.0-20241014055401-9281a208d10e github.com/cristalhq/base64 v0.1.2 + github.com/fsnotify/fsnotify v1.7.0 github.com/goccy/go-yaml v1.12.0 github.com/google/uuid v1.6.0 github.com/gorilla/handlers v1.5.2 github.com/gorilla/mux v1.8.1 - github.com/gripmock/environment v1.0.4 + github.com/gripmock/environment v1.0.5 github.com/gripmock/grpc-interceptors v1.0.5 github.com/gripmock/shutdown v1.0.0 github.com/gripmock/stuber v1.1.5 @@ -22,7 +23,7 @@ require ( github.com/rs/zerolog v1.33.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f + google.golang.org/genproto/googleapis/api v0.0.0-20241015175021-c02fea0c224a google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.1 ) @@ -43,12 +44,12 @@ require ( github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241015175021-c02fea0c224a // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 22d4d81e..9ae0881d 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ github.com/bavix/gripmock-sdk-go v1.0.5 h1:DFZIz5aobjBIsMmBptHkuSdhGzOPlqp3Gn1qH github.com/bavix/gripmock-sdk-go v1.0.5/go.mod h1:/+9vHE4ccPeV+5RecNGpy9NMwccDglH3IeXsrLWVvaY= github.com/bavix/gripmock-ui v1.0.0-alpha9 h1:7HLtboi9XMwXSvoGmrDaaf6mBOA/wreGMkLa1DwQhwk= github.com/bavix/gripmock-ui v1.0.0-alpha9/go.mod h1:XEH4YYEKL+wEDtONntoWm6JxjbVWzl7XtDYztUTBfeA= -github.com/bavix/gripmock/protogen v0.0.0-20240924151019-bd43d64ad313 h1:fv+WRudvdsya7Vtd5IVxhLPPgdUi3Gm7hsvfMsQrEpk= -github.com/bavix/gripmock/protogen v0.0.0-20240924151019-bd43d64ad313/go.mod h1:CZq5XycSXCrHDtmhtECqpOT2dSrw5wxzBIIIxL7GiVE= +github.com/bavix/gripmock/protogen v0.0.0-20241014055401-9281a208d10e h1:maq1Qu/VTlFJ7BEHQRYZogxg8pdAt3zCtVN86Ar17GM= +github.com/bavix/gripmock/protogen v0.0.0-20241014055401-9281a208d10e/go.mod h1:/dnU85LwmoR365svWlnkiQBc23GrdaMbicSecCIxtOk= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= @@ -27,6 +27,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -50,8 +52,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gripmock/deeply v1.2.2 h1:g9d6RsWP0gyRSn0q6G/OR9nG3E80PMp1q502g9Yzl5w= github.com/gripmock/deeply v1.2.2/go.mod h1:nokhzJRncerJIggq4i0pmn3bJVqssY+KebQiVN61TpU= -github.com/gripmock/environment v1.0.4 h1:IqyFkwZ/s5ApJz+OD4yPfax6qlGftDaQ3zOqKNRDuMc= -github.com/gripmock/environment v1.0.4/go.mod h1:nzBAHAw6/OYsng65X5q6HVmTmKtlvTHVdI/0OK1GGgQ= +github.com/gripmock/environment v1.0.5 h1:xgU4NTlV9eM1/BMFTt5pShh42VobsM2Tx86Atd+lgOU= +github.com/gripmock/environment v1.0.5/go.mod h1:nzBAHAw6/OYsng65X5q6HVmTmKtlvTHVdI/0OK1GGgQ= github.com/gripmock/grpc-interceptors v1.0.5 h1:V32RXeasyYxktG3p/0/7c3fSFf7S5JZnTUVgbt2nHaA= github.com/gripmock/grpc-interceptors v1.0.5/go.mod h1:1ntLm4r0eyDYg9zUQ83AZfjdc4Ew+lHwoqns2eXI0EU= github.com/gripmock/shutdown v1.0.0 h1:ESDCCBeNHazgAstCpIskaORNWH3b+P03a2gznW+8IFY= @@ -103,8 +105,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= @@ -118,10 +120,10 @@ golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f h1:jTm13A2itBi3La6yTGqn8bVSrc3ZZ1r8ENHlIXBfnRA= -google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f/go.mod h1:CLGoBuH1VHxAUXVPP8FfPwPEVJB6lz3URE5mY2SuayE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f h1:cUMEy+8oS78BWIH9OWazBkzbr090Od9tWBNtZHkOhf0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241015175021-c02fea0c224a h1:AuTMH6Am1cLV6ykAMRI7YgDUlrI1W6ehU2Z9IQXATrc= +google.golang.org/genproto/googleapis/api v0.0.0-20241015175021-c02fea0c224a/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015175021-c02fea0c224a h1:7l5YhIls8cfaISlcZNCFL4ai8WB/D9Z9VknQt7Efjx8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015175021-c02fea0c224a/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= diff --git a/go.work.sum b/go.work.sum index 9ac66e93..ca42d3b0 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,5 +1,6 @@ cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w= cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= +cel.dev/expr v0.16.0 h1:yloc84fytn4zmJX2GU3TkXGsaieaV7dQ057Qs4sIG2Y= cel.dev/expr v0.16.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/accessapproval v1.7.9/go.mod h1:teNI+P/xzZ3dppGXEYFvSmuOvmTjLE9toPq21WHssYc= @@ -31,6 +32,7 @@ cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//u cloud.google.com/go/compute v1.27.2/go.mod h1:YQuHkNEwP3bIz4LBYQqf4DIMfFtTDtnEgnwG0mJQQ9I= cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/contactcenterinsights v1.13.4/go.mod h1:6OWSyQxeaQRxhkyMhtE+RFOOlsMcKOTukv8nnjxbNCQ= cloud.google.com/go/container v1.37.2/go.mod h1:2ly7zpBmWtYjjuoB3fHyq8Gqrxaj2NIwzwVRpUcKYXk= @@ -155,6 +157,7 @@ github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0TxYVST9h4Ie192jJWpHvthBBgg= github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= @@ -166,9 +169,11 @@ github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjl github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/go-control-plane v0.12.1-0.20240621013728-1eb8caab5155 h1:IgJPqnrlY2Mr4pYB6oaMKvFvwJ9H+X6CCY5x1vCTcpc= github.com/envoyproxy/go-control-plane v0.12.1-0.20240621013728-1eb8caab5155/go.mod h1:5Wkq+JduFtdAXihLmeTJf+tRYIT4KBc2vPXDhwVo1pA= +github.com/envoyproxy/go-control-plane v0.13.0 h1:HzkeUz1Knt+3bK+8LG1bxOO/jzWZmdxpwC51i202les= github.com/envoyproxy/go-control-plane v0.13.0/go.mod h1:GRaKG3dwvFoTg4nj7aXdZnvMg4d7nvT/wl9WgVXn3Q8= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= +github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= @@ -187,6 +192,7 @@ github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6x github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -318,7 +324,6 @@ go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v8 golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= @@ -331,6 +336,7 @@ golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -344,6 +350,7 @@ golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= @@ -369,6 +376,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/internal/app/rest_server.go b/internal/app/rest_server.go index b509c1bb..0aa21b99 100644 --- a/internal/app/rest_server.go +++ b/internal/app/rest_server.go @@ -234,7 +234,7 @@ func (h *RestServer) SearchStubs(w http.ResponseWriter, r *http.Request) { if result.Found() == nil { w.WriteHeader(http.StatusNotFound) - h.writeResponseError(stubNotFoundError2(query, result), w) + h.writeResponseError(stubNotFoundError(query, result), w) return } diff --git a/internal/app/storage.go b/internal/app/storage.go index fc43febb..17f220af 100644 --- a/internal/app/storage.go +++ b/internal/app/storage.go @@ -7,7 +7,7 @@ import ( "github.com/gripmock/stuber" ) -func stubNotFoundError2(expect stuber.Query, result *stuber.Result) error { +func stubNotFoundError(expect stuber.Query, result *stuber.Result) error { template := fmt.Sprintf("Can't find stub \n\nService: %s \n\nMethod: %s \n\nInput\n\n", expect.Service, expect.Method) expectString, err := json.MarshalIndent(expect.Data, "", "\t") diff --git a/internal/deps/stuber.go b/internal/deps/stuber.go index d81b4a7d..e05a4795 100644 --- a/internal/deps/stuber.go +++ b/internal/deps/stuber.go @@ -4,6 +4,7 @@ import ( "github.com/gripmock/stuber" "github.com/bavix/gripmock/internal/infra/storage" + "github.com/bavix/gripmock/internal/infra/watcher" "github.com/bavix/gripmock/pkg/yaml2json" ) @@ -16,5 +17,5 @@ func (b *Builder) Budgerigar() *stuber.Budgerigar { } func (b *Builder) Extender() *storage.Extender { - return storage.NewStub(b.Budgerigar(), yaml2json.New()) + return storage.NewStub(b.Budgerigar(), yaml2json.New(), watcher.NewStubWatcher(b.config)) } diff --git a/internal/domain/rest/api.gen.go b/internal/domain/rest/api.gen.go index f575ac2e..3f428df1 100644 --- a/internal/domain/rest/api.gen.go +++ b/internal/domain/rest/api.gen.go @@ -1,6 +1,6 @@ // Package rest provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. package rest import ( @@ -162,7 +162,6 @@ type MiddlewareFunc func(http.Handler) http.Handler // Liveness operation middleware func (siw *ServerInterfaceWrapper) Liveness(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.Liveness(w, r) @@ -172,12 +171,11 @@ func (siw *ServerInterfaceWrapper) Liveness(w http.ResponseWriter, r *http.Reque handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // Readiness operation middleware func (siw *ServerInterfaceWrapper) Readiness(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.Readiness(w, r) @@ -187,12 +185,11 @@ func (siw *ServerInterfaceWrapper) Readiness(w http.ResponseWriter, r *http.Requ handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // ServicesList operation middleware func (siw *ServerInterfaceWrapper) ServicesList(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.ServicesList(w, r) @@ -202,12 +199,11 @@ func (siw *ServerInterfaceWrapper) ServicesList(w http.ResponseWriter, r *http.R handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // ServiceMethodsList operation middleware func (siw *ServerInterfaceWrapper) ServiceMethodsList(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -228,12 +224,11 @@ func (siw *ServerInterfaceWrapper) ServiceMethodsList(w http.ResponseWriter, r * handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // PurgeStubs operation middleware func (siw *ServerInterfaceWrapper) PurgeStubs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.PurgeStubs(w, r) @@ -243,12 +238,11 @@ func (siw *ServerInterfaceWrapper) PurgeStubs(w http.ResponseWriter, r *http.Req handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // ListStubs operation middleware func (siw *ServerInterfaceWrapper) ListStubs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.ListStubs(w, r) @@ -258,12 +252,11 @@ func (siw *ServerInterfaceWrapper) ListStubs(w http.ResponseWriter, r *http.Requ handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // AddStub operation middleware func (siw *ServerInterfaceWrapper) AddStub(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.AddStub(w, r) @@ -273,12 +266,11 @@ func (siw *ServerInterfaceWrapper) AddStub(w http.ResponseWriter, r *http.Reques handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // BatchStubsDelete operation middleware func (siw *ServerInterfaceWrapper) BatchStubsDelete(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.BatchStubsDelete(w, r) @@ -288,12 +280,11 @@ func (siw *ServerInterfaceWrapper) BatchStubsDelete(w http.ResponseWriter, r *ht handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // SearchStubs operation middleware func (siw *ServerInterfaceWrapper) SearchStubs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.SearchStubs(w, r) @@ -303,12 +294,11 @@ func (siw *ServerInterfaceWrapper) SearchStubs(w http.ResponseWriter, r *http.Re handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // ListUnusedStubs operation middleware func (siw *ServerInterfaceWrapper) ListUnusedStubs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.ListUnusedStubs(w, r) @@ -318,12 +308,11 @@ func (siw *ServerInterfaceWrapper) ListUnusedStubs(w http.ResponseWriter, r *htt handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // ListUsedStubs operation middleware func (siw *ServerInterfaceWrapper) ListUsedStubs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.ListUsedStubs(w, r) @@ -333,12 +322,11 @@ func (siw *ServerInterfaceWrapper) ListUsedStubs(w http.ResponseWriter, r *http. handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // DeleteStubByID operation middleware func (siw *ServerInterfaceWrapper) DeleteStubByID(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -359,12 +347,11 @@ func (siw *ServerInterfaceWrapper) DeleteStubByID(w http.ResponseWriter, r *http handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // FindByID operation middleware func (siw *ServerInterfaceWrapper) FindByID(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -385,7 +372,7 @@ func (siw *ServerInterfaceWrapper) FindByID(w http.ResponseWriter, r *http.Reque handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } type UnescapedCookieParamError struct { diff --git a/internal/infra/storage/stubs.go b/internal/infra/storage/stubs.go index c4751fee..3b152dc5 100644 --- a/internal/infra/storage/stubs.go +++ b/internal/infra/storage/stubs.go @@ -10,6 +10,7 @@ import ( "github.com/gripmock/stuber" "github.com/rs/zerolog" + "github.com/bavix/gripmock/internal/infra/watcher" "github.com/bavix/gripmock/pkg/jsondecoder" "github.com/bavix/gripmock/pkg/yaml2json" ) @@ -18,16 +19,19 @@ type Extender struct { storage *stuber.Budgerigar convertor *yaml2json.Convertor ch chan struct{} + watcher *watcher.StubWatcher } func NewStub( storage *stuber.Budgerigar, convertor *yaml2json.Convertor, + watcher *watcher.StubWatcher, ) *Extender { return &Extender{ storage: storage, convertor: convertor, ch: make(chan struct{}), + watcher: watcher, } } @@ -36,14 +40,32 @@ func (s *Extender) Wait() { } func (s *Extender) ReadFromPath(ctx context.Context, pathDir string) { - defer close(s.ch) + if pathDir == "" { + close(s.ch) + + return + } + s.readFromPath(ctx, pathDir) + close(s.ch) + + ch, err := s.watcher.Watch(ctx, pathDir) + if err != nil { + return + } + + for file := range ch { + s.readByFile(ctx, file, true) + } } // readFromPath reads all the stubs from the given directory and its subdirectories, // and adds them to the server's stub store. // The stub files can be in yaml or json format. // If a file is in yaml format, it will be converted to json format. +// +// If `update` is true, the stubs will be updated in the server's stub store. +// Otherwise, the stubs will be added to the server's stub store. func (s *Extender) readFromPath(ctx context.Context, pathDir string) { files, err := os.ReadDir(pathDir) if err != nil { @@ -62,18 +84,33 @@ func (s *Extender) readFromPath(ctx context.Context, pathDir string) { continue } - // Read the stub file and add it to the server's stub store. - stubs, err := s.readStub(path.Join(pathDir, file.Name())) - if err != nil { - zerolog.Ctx(ctx). - Err(err). - Str("path", pathDir). - Str("file", file.Name()). - Msg("read file") - + // If the file is not a stub file, skip it. + if !strings.HasSuffix(file.Name(), ".json") && + !strings.HasSuffix(file.Name(), ".yaml") && + !strings.HasSuffix(file.Name(), ".yml") { continue } + s.readByFile(ctx, path.Join(pathDir, file.Name()), false) + } +} + +func (s *Extender) readByFile(ctx context.Context, currentFile string, update bool) { + // Read the stub file and add it to the server's stub store. + stubs, err := s.readStub(currentFile) + if err != nil { + zerolog.Ctx(ctx). + Err(err). + Str("file", currentFile). + Msg("read file") + + return + } + + // Update or add the stubs to the server's stub store. + if update { + s.storage.UpdateMany(stubs...) + } else { s.storage.PutMany(stubs...) } } diff --git a/internal/infra/watcher/stub.go b/internal/infra/watcher/stub.go new file mode 100644 index 00000000..6c54a130 --- /dev/null +++ b/internal/infra/watcher/stub.go @@ -0,0 +1,174 @@ +package watcher + +import ( + "context" + "io/fs" + "path" + "path/filepath" + "slices" + "strings" + "time" + + "github.com/fsnotify/fsnotify" + "github.com/gripmock/environment" + "github.com/rs/zerolog" +) + +type StubWatcher struct { + enabled bool + interval time.Duration + watcherType string +} + +func NewStubWatcher( + cfg environment.Config, +) *StubWatcher { + watcherType := string(cfg.StubWatcherType) + + if !slices.Contains( + []string{ + string(environment.WatcherFSNotify), + string(environment.WatcherTimer), + }, + watcherType, + ) { + watcherType = string(environment.WatcherFSNotify) + } + + return &StubWatcher{ + enabled: cfg.StubWatcherEnabled, + interval: cfg.StubWatcherInterval, + watcherType: watcherType, + } +} + +func (s *StubWatcher) Watch(ctx context.Context, folderPath string) (<-chan string, error) { + if !s.enabled { + ch := make(chan string) + close(ch) + + return ch, nil + } + + zerolog.Ctx(ctx).Info(). + Str("folder", folderPath). + Str("type", s.watcherType). + Msg("Watching stub files") + + if s.watcherType == string(environment.WatcherFSNotify) { + return s.notify(ctx, folderPath) + } + + return s.ticker(ctx, folderPath) +} + +func (s *StubWatcher) notify(ctx context.Context, folderPath string) (<-chan string, error) { + watcher, err := fsnotify.NewWatcher() + if err != nil { + return nil, err + } + + ch := make(chan string) + + go func() { + defer watcher.Close() + defer close(ch) + + for { + select { + case <-ctx.Done(): + return + case event, ok := <-watcher.Events: + if !ok || event.Op == fsnotify.Chmod { + continue + } + + stubPath := path.Join(folderPath, event.Name) + + if isStub(stubPath) { + zerolog.Ctx(ctx). + Debug(). + Str("path", event.Name). + Msg("updating stub") + + ch <- event.Name + } + } + } + }() + + _ = filepath.Walk(folderPath, func(currentPath string, info fs.FileInfo, err error) error { + if err != nil { + return err + } + + if !info.IsDir() { + return nil + } + + zerolog.Ctx(ctx).Err(watcher.Add(currentPath)). + Str("path", currentPath). + Msg("watching stub directory") + + return nil + }) + + return ch, nil +} + +//nolint:gocognit +func (s *StubWatcher) ticker(ctx context.Context, folderPath string) (<-chan string, error) { + ch := make(chan string) + + stubFiles := make(map[string]time.Time, 128) //nolint:mnd + + go func() { + ticker := time.NewTicker(s.interval) + defer ticker.Stop() + defer close(ch) + + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + _ = filepath.Walk(folderPath, func(currentPath string, info fs.FileInfo, err error) error { + if err != nil { + return err + } + + if info.IsDir() { + return nil + } + + if lastModifyTime, ok := stubFiles[currentPath]; ok { + if info.ModTime().Equal(lastModifyTime) { + return nil + } + } + + if isStub(currentPath) { + stubFiles[currentPath] = info.ModTime() + + zerolog.Ctx(ctx). + Debug(). + Str("path", currentPath). + Msg("updating stub") + + ch <- currentPath + } + + return nil + }) + } + } + }() + + return ch, nil +} + +func isStub(path string) bool { + return strings.HasSuffix(path, ".json") || + strings.HasSuffix(path, ".yaml") || + strings.HasSuffix(path, ".yml") +} diff --git a/protogen/example/ms/ms.pb.go b/protogen/example/ms/ms.pb.go index 13c54b21..c59adade 100644 --- a/protogen/example/ms/ms.pb.go +++ b/protogen/example/ms/ms.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: ms.proto package ms diff --git a/protogen/example/ms/ms_grpc.pb.go b/protogen/example/ms/ms_grpc.pb.go index cb8e0ebe..8b1c7c8c 100644 --- a/protogen/example/ms/ms_grpc.pb.go +++ b/protogen/example/ms/ms_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: ms.proto package ms diff --git a/protogen/example/multi-files/file1.pb.go b/protogen/example/multi-files/file1.pb.go index 24d367ae..c180bc35 100644 --- a/protogen/example/multi-files/file1.pb.go +++ b/protogen/example/multi-files/file1.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: file1.proto package multi_files diff --git a/protogen/example/multi-files/file1_grpc.pb.go b/protogen/example/multi-files/file1_grpc.pb.go index de87f110..74e9000f 100644 --- a/protogen/example/multi-files/file1_grpc.pb.go +++ b/protogen/example/multi-files/file1_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: file1.proto package multi_files diff --git a/protogen/example/multi-files/file2.pb.go b/protogen/example/multi-files/file2.pb.go index 5adaff2d..9dc44c8f 100644 --- a/protogen/example/multi-files/file2.pb.go +++ b/protogen/example/multi-files/file2.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: file2.proto package multi_files diff --git a/protogen/example/multi-files/file2_grpc.pb.go b/protogen/example/multi-files/file2_grpc.pb.go index 8699a128..22fb1b7b 100644 --- a/protogen/example/multi-files/file2_grpc.pb.go +++ b/protogen/example/multi-files/file2_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: file2.proto package multi_files diff --git a/protogen/example/multi-package/bar/bar.pb.go b/protogen/example/multi-package/bar/bar.pb.go index 9cad8297..827a7560 100644 --- a/protogen/example/multi-package/bar/bar.pb.go +++ b/protogen/example/multi-package/bar/bar.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: bar/bar.proto package bar diff --git a/protogen/example/multi-package/foo.pb.go b/protogen/example/multi-package/foo.pb.go index a922adbf..1db062f2 100644 --- a/protogen/example/multi-package/foo.pb.go +++ b/protogen/example/multi-package/foo.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: foo.proto // simulating neighboring .proto file diff --git a/protogen/example/multi-package/hello.pb.go b/protogen/example/multi-package/hello.pb.go index d8ff3045..9625f0d2 100644 --- a/protogen/example/multi-package/hello.pb.go +++ b/protogen/example/multi-package/hello.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: hello.proto package multi_package diff --git a/protogen/example/multi-package/hello_grpc.pb.go b/protogen/example/multi-package/hello_grpc.pb.go index c0f6e9d2..9df762d3 100644 --- a/protogen/example/multi-package/hello_grpc.pb.go +++ b/protogen/example/multi-package/hello_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: hello.proto package multi_package diff --git a/protogen/example/one-of/oneof.pb.go b/protogen/example/one-of/oneof.pb.go index 17f8dd44..cf182593 100644 --- a/protogen/example/one-of/oneof.pb.go +++ b/protogen/example/one-of/oneof.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: oneof.proto package one_of diff --git a/protogen/example/one-of/oneof_grpc.pb.go b/protogen/example/one-of/oneof_grpc.pb.go index 31a3c429..57d8cc28 100644 --- a/protogen/example/one-of/oneof_grpc.pb.go +++ b/protogen/example/one-of/oneof_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: oneof.proto package one_of diff --git a/protogen/example/simple/simple.pb.go b/protogen/example/simple/simple.pb.go index 4ac39b8f..494d3705 100644 --- a/protogen/example/simple/simple.pb.go +++ b/protogen/example/simple/simple.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: simple.proto package simple diff --git a/protogen/example/simple/simple_grpc.pb.go b/protogen/example/simple/simple_grpc.pb.go index b95b5c67..04152ada 100644 --- a/protogen/example/simple/simple_grpc.pb.go +++ b/protogen/example/simple/simple_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: simple.proto package simple diff --git a/protogen/example/stream/stream.pb.go b/protogen/example/stream/stream.pb.go index 4ef39075..22a8fef4 100644 --- a/protogen/example/stream/stream.pb.go +++ b/protogen/example/stream/stream.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: stream.proto package stream diff --git a/protogen/example/stream/stream_grpc.pb.go b/protogen/example/stream/stream_grpc.pb.go index 71a8f13d..a01b2dac 100644 --- a/protogen/example/stream/stream_grpc.pb.go +++ b/protogen/example/stream/stream_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: stream.proto package stream diff --git a/protogen/example/strictmode/method.pb.go b/protogen/example/strictmode/method.pb.go index d663926d..5ccbc08f 100644 --- a/protogen/example/strictmode/method.pb.go +++ b/protogen/example/strictmode/method.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: method.proto package strictmode diff --git a/protogen/example/strictmode/method_grpc.pb.go b/protogen/example/strictmode/method_grpc.pb.go index c50ba650..e6a45e88 100644 --- a/protogen/example/strictmode/method_grpc.pb.go +++ b/protogen/example/strictmode/method_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: method.proto package strictmode diff --git a/protogen/example/stub-subfolders/stub-subfolders.pb.go b/protogen/example/stub-subfolders/stub-subfolders.pb.go index cb2b9c97..fd6f16a2 100644 --- a/protogen/example/stub-subfolders/stub-subfolders.pb.go +++ b/protogen/example/stub-subfolders/stub-subfolders.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: stub-subfolders.proto package stub_subfolders diff --git a/protogen/example/stub-subfolders/stub-subfolders_grpc.pb.go b/protogen/example/stub-subfolders/stub-subfolders_grpc.pb.go index 1d02db53..8d8860b0 100644 --- a/protogen/example/stub-subfolders/stub-subfolders_grpc.pb.go +++ b/protogen/example/stub-subfolders/stub-subfolders_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: stub-subfolders.proto package stub_subfolders diff --git a/protogen/example/well_known_types/wkt.pb.go b/protogen/example/well_known_types/wkt.pb.go index 7daf962d..ce2dcc53 100644 --- a/protogen/example/well_known_types/wkt.pb.go +++ b/protogen/example/well_known_types/wkt.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.2 // source: wkt.proto package well_known_types diff --git a/protogen/example/well_known_types/wkt_grpc.pb.go b/protogen/example/well_known_types/wkt_grpc.pb.go index 5dfa7717..2c9944ce 100644 --- a/protogen/example/well_known_types/wkt_grpc.pb.go +++ b/protogen/example/well_known_types/wkt_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.2 // source: wkt.proto package well_known_types diff --git a/protogen/go.mod b/protogen/go.mod index b22478d7..b8c5178a 100644 --- a/protogen/go.mod +++ b/protogen/go.mod @@ -3,7 +3,7 @@ module github.com/bavix/gripmock/protogen go 1.23.2 require ( - google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f + google.golang.org/genproto/googleapis/api v0.0.0-20241015175021-c02fea0c224a google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.1 ) @@ -12,5 +12,5 @@ require ( golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241015175021-c02fea0c224a // indirect ) diff --git a/protogen/go.sum b/protogen/go.sum index f3ddbb33..a624bf04 100644 --- a/protogen/go.sum +++ b/protogen/go.sum @@ -6,10 +6,10 @@ golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f h1:jTm13A2itBi3La6yTGqn8bVSrc3ZZ1r8ENHlIXBfnRA= -google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f/go.mod h1:CLGoBuH1VHxAUXVPP8FfPwPEVJB6lz3URE5mY2SuayE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f h1:cUMEy+8oS78BWIH9OWazBkzbr090Od9tWBNtZHkOhf0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241015175021-c02fea0c224a h1:AuTMH6Am1cLV6ykAMRI7YgDUlrI1W6ehU2Z9IQXATrc= +google.golang.org/genproto/googleapis/api v0.0.0-20241015175021-c02fea0c224a/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015175021-c02fea0c224a h1:7l5YhIls8cfaISlcZNCFL4ai8WB/D9Z9VknQt7Efjx8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015175021-c02fea0c224a/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=