diff options
Diffstat (limited to 'lib/go/thrift/simple_json_protocol.go')
-rw-r--r-- | lib/go/thrift/simple_json_protocol.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/go/thrift/simple_json_protocol.go b/lib/go/thrift/simple_json_protocol.go index 5cefb600a..8b1284fd1 100644 --- a/lib/go/thrift/simple_json_protocol.go +++ b/lib/go/thrift/simple_json_protocol.go @@ -93,7 +93,6 @@ var errEmptyJSONContextStack = NewTProtocolExceptionWithType(INVALID_DATA, error // This protocol produces/consumes a simple output format // suitable for parsing by scripting languages. It should not be // confused with the full-featured TJSONProtocol. -// type TSimpleJSONProtocol struct { trans TTransport @@ -341,6 +340,10 @@ func (p *TSimpleJSONProtocol) WriteBinary(ctx context.Context, v []byte) error { return p.OutputPostValue() } +func (p *TSimpleJSONProtocol) WriteUUID(ctx context.Context, v Tuuid) error { + return p.OutputString(v.String()) +} + // Reading methods. func (p *TSimpleJSONProtocol) ReadMessageBegin(ctx context.Context) (name string, typeId TMessageType, seqId int32, err error) { p.resetContextStack() // THRIFT-3735 @@ -595,6 +598,16 @@ func (p *TSimpleJSONProtocol) ReadBinary(ctx context.Context) ([]byte, error) { return v, p.ParsePostValue() } +func (p *TSimpleJSONProtocol) ReadUUID(ctx context.Context) (v Tuuid, err error) { + var s string + s, err = p.ReadString(ctx) + if err != nil { + return v, err + } + v, err = ParseTuuid(s) + return v, NewTProtocolExceptionWithType(INVALID_DATA, err) +} + func (p *TSimpleJSONProtocol) Flush(ctx context.Context) (err error) { return NewTProtocolException(p.writer.Flush()) } |