Skip to content

Commit

Permalink
Bump thriftrw-go to f40a16c86 in root and internal/examples
Browse files Browse the repository at this point in the history
Bump thriftrw-go to consume the new no-wire (streaming) implementation.  Also
stop using deprecated fields (except in tests) and regenerate all of the
thriftrw relevant files.
  • Loading branch information
witriew committed Aug 17, 2021
1 parent 3835140 commit 13ea32e
Show file tree
Hide file tree
Showing 25 changed files with 13,722 additions and 1,864 deletions.
4 changes: 2 additions & 2 deletions encoding/thrift/envelope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"go.uber.org/thriftrw/protocol"
"go.uber.org/thriftrw/protocol/binary"
"go.uber.org/thriftrw/wire"
)

Expand Down Expand Up @@ -63,7 +63,7 @@ func TestDisableEnveloperEncode(t *testing.T) {
generate(&e.SeqID, rand)

var buffer bytes.Buffer
proto := disableEnvelopingProtocol{protocol.Binary, wire.Reply}
proto := disableEnvelopingProtocol{binary.Default, wire.Reply}
if !assert.NoError(t, proto.EncodeEnveloped(e, &buffer)) {
continue
}
Expand Down
9 changes: 6 additions & 3 deletions encoding/thrift/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"io"

"go.uber.org/thriftrw/protocol"
"go.uber.org/thriftrw/protocol/envelope"
"go.uber.org/thriftrw/wire"
encodingapi "go.uber.org/yarpc/api/encoding"
"go.uber.org/yarpc/api/transport"
Expand Down Expand Up @@ -139,7 +140,7 @@ func decodeRequest(
wire.Value,
// how to encode the response, with the enveloping
// strategy corresponding to the request. It is not used for oneway handlers.
protocol.Responder,
envelope.Responder,
error,
) {
if err := errors.ExpectEncodings(treq, Encoding); err != nil {
Expand All @@ -166,7 +167,7 @@ func decodeEnvelopedRequest(
reqEnvelopeType wire.EnvelopeType,
proto protocol.Protocol,
reader io.ReaderAt,
) (wire.Value, protocol.Responder, error) {
) (wire.Value, envelope.Responder, error) {
var envelope wire.Envelope
envelope, err := proto.DecodeEnveloped(reader)
if err != nil {
Expand All @@ -177,18 +178,20 @@ func decodeEnvelopedRequest(
return wire.Value{}, nil, err
}
reqValue := envelope.Value
//lint:ignore SA1019 explicit use for known enveloping
responder := protocol.EnvelopeV1Responder{Name: envelope.Name, SeqID: envelope.SeqID}
return reqValue, responder, nil
}

func decodeUnenvelopedRequest(
proto protocol.Protocol,
reader io.ReaderAt,
) (wire.Value, protocol.Responder, error) {
) (wire.Value, envelope.Responder, error) {
reqValue, err := proto.Decode(reader, wire.TStruct)
if err != nil {
return wire.Value{}, nil, err
}
//lint:ignore SA1019 explicit use for known enveloping
responder := protocol.NoEnvelopeResponder
return reqValue, responder, err
}
Expand Down
1 change: 1 addition & 0 deletions encoding/thrift/inbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

//lint:file-ignore SA1019 'mock' usage
package thrift

import (
Expand Down
129 changes: 128 additions & 1 deletion encoding/thrift/internal/internal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 13ea32e

Please sign in to comment.