(ctx context.Context)
| 379 | } |
| 380 | |
| 381 | func (p *TSimpleJSONProtocol) ReadFieldBegin(ctx context.Context) (string, TType, int16, error) { |
| 382 | if err := p.ParsePreValue(); err != nil { |
| 383 | return "", STOP, 0, err |
| 384 | } |
| 385 | b, _ := p.reader.Peek(1) |
| 386 | if len(b) > 0 { |
| 387 | switch b[0] { |
| 388 | case JSON_RBRACE[0]: |
| 389 | return "", STOP, 0, nil |
| 390 | case JSON_QUOTE: |
| 391 | p.reader.ReadByte() |
| 392 | name, err := p.ParseStringBody() |
| 393 | // simplejson is not meant to be read back into thrift |
| 394 | // - see http://wiki.apache.org/thrift/ThriftUsageJava |
| 395 | // - use JSON instead |
| 396 | if err != nil { |
| 397 | return name, STOP, 0, err |
| 398 | } |
| 399 | return name, STOP, -1, p.ParsePostValue() |
| 400 | } |
| 401 | e := fmt.Errorf("Expected \"}\" or '\"', but found: '%s'", string(b)) |
| 402 | return "", STOP, 0, NewTProtocolExceptionWithType(INVALID_DATA, e) |
| 403 | } |
| 404 | return "", STOP, 0, NewTProtocolException(io.EOF) |
| 405 | } |
| 406 | |
| 407 | func (p *TSimpleJSONProtocol) ReadFieldEnd(ctx context.Context) error { |
| 408 | return nil |
nothing calls this directly
no test coverage detected