diff --git a/clientcompat/internal/clientcompat/clientcompat.twirp.go b/clientcompat/internal/clientcompat/clientcompat.twirp.go index acca9493..1bc7b914 100644 --- a/clientcompat/internal/clientcompat/clientcompat.twirp.go +++ b/clientcompat/internal/clientcompat/clientcompat.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: clientcompat.proto /* Package clientcompat is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: clientcompat.proto @@ -513,7 +513,7 @@ func (s *compatServiceServer) ServiceDescriptor() ([]byte, int) { } func (s *compatServiceServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *compatServiceServer) PathPrefix() string { @@ -654,7 +654,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/clientcompat/pycompat/clientcompat_pb2_twirp.py b/clientcompat/pycompat/clientcompat_pb2_twirp.py index d242235f..7126b229 100644 --- a/clientcompat/pycompat/clientcompat_pb2_twirp.py +++ b/clientcompat/pycompat/clientcompat_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: clientcompat.proto try: diff --git a/example/service.twirp.go b/example/service.twirp.go index 2b47dca4..4ef1d377 100644 --- a/example/service.twirp.go +++ b/example/service.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: service.proto /* Package example is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: service.proto @@ -339,7 +339,7 @@ func (s *haberdasherServer) ServiceDescriptor() ([]byte, int) { } func (s *haberdasherServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *haberdasherServer) PathPrefix() string { @@ -480,7 +480,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/example/service_pb2_twirp.py b/example/service_pb2_twirp.py index 1cf1710b..3d639827 100644 --- a/example/service_pb2_twirp.py +++ b/example/service_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: service.proto try: diff --git a/internal/gen/version.go b/internal/gen/version.go index 2c283125..13a37322 100644 --- a/internal/gen/version.go +++ b/internal/gen/version.go @@ -13,4 +13,4 @@ package gen -const Version = "v5.10.1" +const Version = "v5.10.2" diff --git a/internal/twirptest/empty_service/empty_service.twirp.go b/internal/twirptest/empty_service/empty_service.twirp.go index cfeb401c..639bf56c 100644 --- a/internal/twirptest/empty_service/empty_service.twirp.go +++ b/internal/twirptest/empty_service/empty_service.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: empty_service.proto /* Package empty_service is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: empty_service.proto @@ -157,7 +157,7 @@ func (s *emptyServer) ServiceDescriptor() ([]byte, int) { } func (s *emptyServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *emptyServer) PathPrefix() string { @@ -298,7 +298,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/empty_service/empty_service_pb2_twirp.py b/internal/twirptest/empty_service/empty_service_pb2_twirp.py index ee0afab5..907fcd5e 100644 --- a/internal/twirptest/empty_service/empty_service_pb2_twirp.py +++ b/internal/twirptest/empty_service/empty_service_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: empty_service.proto try: diff --git a/internal/twirptest/gogo_compat/service.twirp.go b/internal/twirptest/gogo_compat/service.twirp.go index c28c3b55..4666cde8 100644 --- a/internal/twirptest/gogo_compat/service.twirp.go +++ b/internal/twirptest/gogo_compat/service.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: service.proto /* Package gogo_compat is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. Test to make sure that Twirp plays well with code generated with github.com/gogo/protobuf/protoc-gen-gofast. @@ -341,7 +341,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -482,7 +482,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/google_protobuf_imports/service.twirp.go b/internal/twirptest/google_protobuf_imports/service.twirp.go index dbdda386..940e1eaf 100644 --- a/internal/twirptest/google_protobuf_imports/service.twirp.go +++ b/internal/twirptest/google_protobuf_imports/service.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: service.proto /* Package google_protobuf_imports is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: service.proto @@ -23,8 +23,8 @@ import proto "github.com/golang/protobuf/proto" import twirp "github.com/twitchtv/twirp" import ctxsetters "github.com/twitchtv/twirp/ctxsetters" -import google_protobuf1 "github.com/golang/protobuf/ptypes/wrappers" import google_protobuf "github.com/golang/protobuf/ptypes/empty" +import google_protobuf1 "github.com/golang/protobuf/ptypes/wrappers" // Imports only used by utility functions: import io "io" @@ -340,7 +340,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -481,7 +481,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/google_protobuf_imports/service_pb2_twirp.py b/internal/twirptest/google_protobuf_imports/service_pb2_twirp.py index ac97dca3..144274a5 100644 --- a/internal/twirptest/google_protobuf_imports/service_pb2_twirp.py +++ b/internal/twirptest/google_protobuf_imports/service_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: service.proto try: diff --git a/internal/twirptest/importable/importable.twirp.go b/internal/twirptest/importable/importable.twirp.go index b0f5362e..3c14fe26 100644 --- a/internal/twirptest/importable/importable.twirp.go +++ b/internal/twirptest/importable/importable.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: importable.proto /* Package importable is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. Test to make sure that importing other packages doesnt break @@ -340,7 +340,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -481,7 +481,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/importable/importable_pb2_twirp.py b/internal/twirptest/importable/importable_pb2_twirp.py index fa6641d4..c38ecaaf 100644 --- a/internal/twirptest/importable/importable_pb2_twirp.py +++ b/internal/twirptest/importable/importable_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: importable.proto try: diff --git a/internal/twirptest/importer/importer.twirp.go b/internal/twirptest/importer/importer.twirp.go index 4a6e4f16..7e94a886 100644 --- a/internal/twirptest/importer/importer.twirp.go +++ b/internal/twirptest/importer/importer.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: importer.proto /* Package importer is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. Test to make sure that importing other packages doesnt break @@ -342,7 +342,7 @@ func (s *svc2Server) ServiceDescriptor() ([]byte, int) { } func (s *svc2Server) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svc2Server) PathPrefix() string { @@ -483,7 +483,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/importer/importer_pb2_twirp.py b/internal/twirptest/importer/importer_pb2_twirp.py index b6dc89e4..fd4a0b95 100644 --- a/internal/twirptest/importer/importer_pb2_twirp.py +++ b/internal/twirptest/importer/importer_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: importer.proto try: diff --git a/internal/twirptest/importer_local/importer_local.twirp.go b/internal/twirptest/importer_local/importer_local.twirp.go index f85c7001..bdd812eb 100644 --- a/internal/twirptest/importer_local/importer_local.twirp.go +++ b/internal/twirptest/importer_local/importer_local.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.9.0, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: importer_local.proto /* Package importer_local is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.9.0. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: importer_local.proto @@ -43,24 +43,30 @@ type Svc interface { type svcProtobufClient struct { client HTTPClient urls [1]string + opts twirp.ClientOptions } // NewSvcProtobufClient creates a Protobuf client that implements the Svc interface. // It communicates using Protobuf and can be configured with a custom HTTPClient. -func NewSvcProtobufClient(addr string, client HTTPClient) Svc { +func NewSvcProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) Svc { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + prefix := urlBase(addr) + SvcPathPrefix urls := [1]string{ prefix + "Send", } - if httpClient, ok := client.(*http.Client); ok { - return &svcProtobufClient{ - client: withoutRedirects(httpClient), - urls: urls, - } - } + return &svcProtobufClient{ client: client, urls: urls, + opts: clientOpts, } } @@ -69,10 +75,18 @@ func (c *svcProtobufClient) Send(ctx context.Context, in *Msg) (*Msg, error) { ctx = ctxsetters.WithServiceName(ctx, "Svc") ctx = ctxsetters.WithMethodName(ctx, "Send") out := new(Msg) - err := doProtobufRequest(ctx, c.client, c.urls[0], in, out) + err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) return nil, err } + + callClientResponseReceived(ctx, c.opts.Hooks) + return out, nil } @@ -83,24 +97,30 @@ func (c *svcProtobufClient) Send(ctx context.Context, in *Msg) (*Msg, error) { type svcJSONClient struct { client HTTPClient urls [1]string + opts twirp.ClientOptions } // NewSvcJSONClient creates a JSON client that implements the Svc interface. // It communicates using JSON and can be configured with a custom HTTPClient. -func NewSvcJSONClient(addr string, client HTTPClient) Svc { +func NewSvcJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) Svc { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + prefix := urlBase(addr) + SvcPathPrefix urls := [1]string{ prefix + "Send", } - if httpClient, ok := client.(*http.Client); ok { - return &svcJSONClient{ - client: withoutRedirects(httpClient), - urls: urls, - } - } + return &svcJSONClient{ client: client, urls: urls, + opts: clientOpts, } } @@ -109,10 +129,18 @@ func (c *svcJSONClient) Send(ctx context.Context, in *Msg) (*Msg, error) { ctx = ctxsetters.WithServiceName(ctx, "Svc") ctx = ctxsetters.WithMethodName(ctx, "Send") out := new(Msg) - err := doJSONRequest(ctx, c.client, c.urls[0], in, out) + err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) return nil, err } + + callClientResponseReceived(ctx, c.opts.Hooks) + return out, nil } @@ -309,7 +337,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.9.0" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -450,7 +478,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.9.0") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } @@ -518,7 +546,7 @@ func errorFromResponse(resp *http.Response) twirp.Error { errorCode := twirp.ErrorCode(tj.Code) if !twirp.IsValidErrorCode(errorCode) { msg := "invalid type returned from server error response: " + tj.Code - return twirp.InternalError(msg) + return twirp.InternalError(msg).WithMeta("body", string(respBodyBytes)) } twerr := twirp.NewError(errorCode, tj.Msg) @@ -662,7 +690,7 @@ func withoutRedirects(in *http.Client) *http.Client { } // doProtobufRequest makes a Protobuf request to the remote Twirp service. -func doProtobufRequest(ctx context.Context, client HTTPClient, url string, in, out proto.Message) (err error) { +func doProtobufRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (err error) { reqBodyBytes, err := proto.Marshal(in) if err != nil { return wrapInternal(err, "failed to marshal proto request") @@ -676,6 +704,12 @@ func doProtobufRequest(ctx context.Context, client HTTPClient, url string, in, o if err != nil { return wrapInternal(err, "could not build request") } + ctx, err = callClientRequestPrepared(ctx, hooks, req) + if err != nil { + return err + } + + req = req.WithContext(ctx) resp, err := client.Do(req) if err != nil { return wrapInternal(err, "failed to do request") @@ -711,7 +745,7 @@ func doProtobufRequest(ctx context.Context, client HTTPClient, url string, in, o } // doJSONRequest makes a JSON request to the remote Twirp service. -func doJSONRequest(ctx context.Context, client HTTPClient, url string, in, out proto.Message) (err error) { +func doJSONRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (err error) { reqBody := bytes.NewBuffer(nil) marshaler := &jsonpb.Marshaler{OrigName: true} if err = marshaler.Marshal(reqBody, in); err != nil { @@ -725,6 +759,12 @@ func doJSONRequest(ctx context.Context, client HTTPClient, url string, in, out p if err != nil { return wrapInternal(err, "could not build request") } + ctx, err = callClientRequestPrepared(ctx, hooks, req) + if err != nil { + return err + } + + req = req.WithContext(ctx) resp, err := client.Do(req) if err != nil { return wrapInternal(err, "failed to do request") @@ -795,6 +835,27 @@ func callError(ctx context.Context, h *twirp.ServerHooks, err twirp.Error) conte return h.Error(ctx, err) } +func callClientResponseReceived(ctx context.Context, h *twirp.ClientHooks) { + if h == nil || h.ResponseReceived == nil { + return + } + h.ResponseReceived(ctx) +} + +func callClientRequestPrepared(ctx context.Context, h *twirp.ClientHooks, req *http.Request) (context.Context, error) { + if h == nil || h.RequestPrepared == nil { + return ctx, nil + } + return h.RequestPrepared(ctx, req) +} + +func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error) { + if h == nil || h.Error == nil { + return + } + h.Error(ctx, err) +} + var twirpFileDescriptor0 = []byte{ // 154 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc9, 0xcc, 0x2d, 0xc8, diff --git a/internal/twirptest/importer_local/importer_local_msgdef_pb2_twirp.py b/internal/twirptest/importer_local/importer_local_msgdef_pb2_twirp.py index f21d449c..517b6956 100644 --- a/internal/twirptest/importer_local/importer_local_msgdef_pb2_twirp.py +++ b/internal/twirptest/importer_local/importer_local_msgdef_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.9.0, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: importer_local_msgdef.proto try: diff --git a/internal/twirptest/importer_local/importer_local_pb2_twirp.py b/internal/twirptest/importer_local/importer_local_pb2_twirp.py index d6f63a04..27dcccd8 100644 --- a/internal/twirptest/importer_local/importer_local_pb2_twirp.py +++ b/internal/twirptest/importer_local/importer_local_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.9.0, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: importer_local.proto try: diff --git a/internal/twirptest/importmapping/x/x.twirp.go b/internal/twirptest/importmapping/x/x.twirp.go index 5978f286..3222092c 100644 --- a/internal/twirptest/importmapping/x/x.twirp.go +++ b/internal/twirptest/importmapping/x/x.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: x/x.proto /* Package x is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: x/x.proto @@ -339,7 +339,7 @@ func (s *svc1Server) ServiceDescriptor() ([]byte, int) { } func (s *svc1Server) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svc1Server) PathPrefix() string { @@ -480,7 +480,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/importmapping/x/x_pb2_twirp.py b/internal/twirptest/importmapping/x/x_pb2_twirp.py index 60cb19d7..d531c062 100644 --- a/internal/twirptest/importmapping/x/x_pb2_twirp.py +++ b/internal/twirptest/importmapping/x/x_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: x/x.proto try: diff --git a/internal/twirptest/importmapping/y/y_pb2_twirp.py b/internal/twirptest/importmapping/y/y_pb2_twirp.py index 9a99c87b..71d46b4b 100644 --- a/internal/twirptest/importmapping/y/y_pb2_twirp.py +++ b/internal/twirptest/importmapping/y/y_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: y/y.proto try: diff --git a/internal/twirptest/multiple/multiple1.twirp.go b/internal/twirptest/multiple/multiple1.twirp.go index 969c8421..8b119e0f 100644 --- a/internal/twirptest/multiple/multiple1.twirp.go +++ b/internal/twirptest/multiple/multiple1.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: multiple1.proto /* Package multiple is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. test to make sure that multiple proto files in one package works @@ -341,7 +341,7 @@ func (s *svc1Server) ServiceDescriptor() ([]byte, int) { } func (s *svc1Server) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svc1Server) PathPrefix() string { @@ -482,7 +482,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/multiple/multiple1_pb2_twirp.py b/internal/twirptest/multiple/multiple1_pb2_twirp.py index 546fdd33..2655541f 100644 --- a/internal/twirptest/multiple/multiple1_pb2_twirp.py +++ b/internal/twirptest/multiple/multiple1_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: multiple1.proto try: diff --git a/internal/twirptest/multiple/multiple2.twirp.go b/internal/twirptest/multiple/multiple2.twirp.go index 6ebeeb2e..4cd7aac3 100644 --- a/internal/twirptest/multiple/multiple2.twirp.go +++ b/internal/twirptest/multiple/multiple2.twirp.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: multiple2.proto package multiple @@ -501,7 +501,7 @@ func (s *svc2Server) ServiceDescriptor() ([]byte, int) { } func (s *svc2Server) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svc2Server) PathPrefix() string { diff --git a/internal/twirptest/multiple/multiple2_pb2_twirp.py b/internal/twirptest/multiple/multiple2_pb2_twirp.py index ae53a418..8fa88af3 100644 --- a/internal/twirptest/multiple/multiple2_pb2_twirp.py +++ b/internal/twirptest/multiple/multiple2_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: multiple2.proto try: diff --git a/internal/twirptest/no_package_name/no_package_name.twirp.go b/internal/twirptest/no_package_name/no_package_name.twirp.go index db279e70..fe68f72f 100644 --- a/internal/twirptest/no_package_name/no_package_name.twirp.go +++ b/internal/twirptest/no_package_name/no_package_name.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: no_package_name.proto /* Package no_package_name is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: no_package_name.proto @@ -337,7 +337,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -478,7 +478,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/no_package_name/no_package_name_pb2_twirp.py b/internal/twirptest/no_package_name/no_package_name_pb2_twirp.py index eaa12c08..6a757bc5 100644 --- a/internal/twirptest/no_package_name/no_package_name_pb2_twirp.py +++ b/internal/twirptest/no_package_name/no_package_name_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: no_package_name.proto try: diff --git a/internal/twirptest/no_package_name_importer/no_package_name_importer.twirp.go b/internal/twirptest/no_package_name_importer/no_package_name_importer.twirp.go index 2d2f2d49..62885001 100644 --- a/internal/twirptest/no_package_name_importer/no_package_name_importer.twirp.go +++ b/internal/twirptest/no_package_name_importer/no_package_name_importer.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: no_package_name_importer.proto /* Package no_package_name_importer is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: no_package_name_importer.proto @@ -339,7 +339,7 @@ func (s *svc2Server) ServiceDescriptor() ([]byte, int) { } func (s *svc2Server) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svc2Server) PathPrefix() string { @@ -480,7 +480,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/no_package_name_importer/no_package_name_importer_pb2_twirp.py b/internal/twirptest/no_package_name_importer/no_package_name_importer_pb2_twirp.py index 1854005d..cd0d27f2 100644 --- a/internal/twirptest/no_package_name_importer/no_package_name_importer_pb2_twirp.py +++ b/internal/twirptest/no_package_name_importer/no_package_name_importer_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: no_package_name_importer.proto try: diff --git a/internal/twirptest/proto/proto.twirp.go b/internal/twirptest/proto/proto.twirp.go index 1223155d..6a58fe38 100644 --- a/internal/twirptest/proto/proto.twirp.go +++ b/internal/twirptest/proto/proto.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: proto.proto /* Package proto is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. Test to make sure that a package named proto doesn't break @@ -340,7 +340,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -481,7 +481,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/proto/proto_pb2_twirp.py b/internal/twirptest/proto/proto_pb2_twirp.py index 36573646..004ee3c5 100644 --- a/internal/twirptest/proto/proto_pb2_twirp.py +++ b/internal/twirptest/proto/proto_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: proto.proto try: diff --git a/internal/twirptest/service.twirp.go b/internal/twirptest/service.twirp.go index 58ef7695..0b8f6fd6 100644 --- a/internal/twirptest/service.twirp.go +++ b/internal/twirptest/service.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: service.proto /* Package twirptest is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: service.proto @@ -339,7 +339,7 @@ func (s *haberdasherServer) ServiceDescriptor() ([]byte, int) { } func (s *haberdasherServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *haberdasherServer) PathPrefix() string { @@ -480,7 +480,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/service_method_same_name/service_method_same_name.twirp.go b/internal/twirptest/service_method_same_name/service_method_same_name.twirp.go index 86c3c9bd..2bbe529e 100644 --- a/internal/twirptest/service_method_same_name/service_method_same_name.twirp.go +++ b/internal/twirptest/service_method_same_name/service_method_same_name.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: service_method_same_name.proto /* Package service_method_same_name is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: service_method_same_name.proto @@ -337,7 +337,7 @@ func (s *echoServer) ServiceDescriptor() ([]byte, int) { } func (s *echoServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *echoServer) PathPrefix() string { @@ -478,7 +478,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/service_method_same_name/service_method_same_name_pb2_twirp.py b/internal/twirptest/service_method_same_name/service_method_same_name_pb2_twirp.py index c237e064..97d7cbcf 100644 --- a/internal/twirptest/service_method_same_name/service_method_same_name_pb2_twirp.py +++ b/internal/twirptest/service_method_same_name/service_method_same_name_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: service_method_same_name.proto try: diff --git a/internal/twirptest/service_pb2_twirp.py b/internal/twirptest/service_pb2_twirp.py index 18dcfc20..0001d70b 100644 --- a/internal/twirptest/service_pb2_twirp.py +++ b/internal/twirptest/service_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: service.proto try: diff --git a/internal/twirptest/snake_case_names/snake_case_names.twirp.go b/internal/twirptest/snake_case_names/snake_case_names.twirp.go index 26ceee66..ce6258fd 100644 --- a/internal/twirptest/snake_case_names/snake_case_names.twirp.go +++ b/internal/twirptest/snake_case_names/snake_case_names.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: snake_case_names.proto /* Package snake_case_names is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. Test that protoc-gen-twirp follows the same behavior as protoc-gen-go for converting RPCs and message names from snake case to camel case. @@ -342,7 +342,7 @@ func (s *haberdasherServer) ServiceDescriptor() ([]byte, int) { } func (s *haberdasherServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *haberdasherServer) PathPrefix() string { @@ -483,7 +483,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/snake_case_names/snake_case_names_pb2_twirp.py b/internal/twirptest/snake_case_names/snake_case_names_pb2_twirp.py index 4342e32c..d91a5fe5 100644 --- a/internal/twirptest/snake_case_names/snake_case_names_pb2_twirp.py +++ b/internal/twirptest/snake_case_names/snake_case_names_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: snake_case_names.proto try: diff --git a/internal/twirptest/source_relative/source_relative.twirp.go b/internal/twirptest/source_relative/source_relative.twirp.go index ecf47717..e6c7553e 100644 --- a/internal/twirptest/source_relative/source_relative.twirp.go +++ b/internal/twirptest/source_relative/source_relative.twirp.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-twirp v5.10.1, DO NOT EDIT. +// Code generated by protoc-gen-twirp v5.10.2, DO NOT EDIT. // source: source_relative.proto /* Package source_relative is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1. +This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.2. It is generated from these files: source_relative.proto @@ -337,7 +337,7 @@ func (s *svcServer) ServiceDescriptor() ([]byte, int) { } func (s *svcServer) ProtocGenTwirpVersion() string { - return "v5.10.1" + return "v5.10.2" } func (s *svcServer) PathPrefix() string { @@ -478,7 +478,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v5.10.1") + req.Header.Set("Twirp-Version", "v5.10.2") return req, nil } diff --git a/internal/twirptest/source_relative/source_relative_pb2_twirp.py b/internal/twirptest/source_relative/source_relative_pb2_twirp.py index 00b69253..e01de8e4 100644 --- a/internal/twirptest/source_relative/source_relative_pb2_twirp.py +++ b/internal/twirptest/source_relative/source_relative_pb2_twirp.py @@ -1,4 +1,4 @@ -# Code generated by protoc-gen-twirp_python v5.10.1, DO NOT EDIT. +# Code generated by protoc-gen-twirp_python v5.10.2, DO NOT EDIT. # source: source_relative.proto try: