github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/patches/0006-upgrade-grpc-gateway.patch (about)

     1  From ec8f53eb035966d9545bf0250cba607028759f59 Mon Sep 17 00:00:00 2001
     2  From: Jeremy Yang <jyang@cockroachlabs.com>
     3  Date: Tue, 13 Feb 2024 09:41:51 -0800
     4  Subject: [PATCH] Update to grpc-gateway v2
     5  
     6  This commit applies the changes from https://github.com/cockroachdb/cockroachdb-parser/pull/9
     7  on top of the 23.2 snapshot.
     8  ---
     9   pkg/util/protoutil/jsonpb_marshal.go |  4 +-
    10   pkg/util/protoutil/marshaler.go      |  4 +-
    11  
    12  diff --git a/pkg/util/protoutil/jsonpb_marshal.go b/pkg/util/protoutil/jsonpb_marshal.go
    13  index cd02994..22aa5c2 100644
    14  --- a/pkg/util/protoutil/jsonpb_marshal.go
    15  +++ b/pkg/util/protoutil/jsonpb_marshal.go
    16  @@ -20,7 +20,7 @@ import (
    17   	"github.com/cockroachdb/errors"
    18   	"github.com/gogo/protobuf/jsonpb"
    19   	"github.com/gogo/protobuf/proto"
    20  -	gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
    21  +	gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
    22   )
    23   
    24   var _ gwruntime.Marshaler = (*JSONPb)(nil)
    25  @@ -31,7 +31,7 @@ var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem()
    26   type JSONPb jsonpb.Marshaler
    27   
    28   // ContentType implements gwruntime.Marshaler.
    29  -func (*JSONPb) ContentType() string {
    30  +func (*JSONPb) ContentType(_ interface{}) string {
    31   	// NB: This is the same as httputil.JSONContentType which we can't use due to
    32   	// an import cycle.
    33   	const JSONContentType = "application/json"
    34  diff --git a/pkg/util/protoutil/marshaler.go b/pkg/util/protoutil/marshaler.go
    35  index 6d835ae..7dfae1e 100644
    36  --- a/pkg/util/protoutil/marshaler.go
    37  +++ b/pkg/util/protoutil/marshaler.go
    38  @@ -15,7 +15,7 @@ import (
    39   
    40   	"github.com/cockroachdb/errors"
    41   	"github.com/gogo/protobuf/proto"
    42  -	gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
    43  +	gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
    44   )
    45   
    46   var _ gwruntime.Marshaler = (*ProtoPb)(nil)
    47  @@ -24,7 +24,7 @@ var _ gwruntime.Marshaler = (*ProtoPb)(nil)
    48   type ProtoPb struct{}
    49   
    50   // ContentType implements gwruntime.Marshaler.
    51  -func (*ProtoPb) ContentType() string {
    52  +func (*ProtoPb) ContentType(_ interface{}) string {
    53   	// NB: This is the same as httputil.ProtoContentType which we can't use due
    54   	// to an import cycle.
    55   	const ProtoContentType = "application/x-protobuf"
    56  -- 
    57  2.38.1
    58