MCPcopy Create free account
hub / github.com/apache/thrift / TypeIdToString

Method TypeIdToString

lib/go/thrift/json_protocol.go:509–539  ·  view source on GitHub ↗
(fieldType TType)

Source from the content-addressed store, hash-verified

507}
508
509func (p *TJSONProtocol) TypeIdToString(fieldType TType) (string, error) {
510 switch byte(fieldType) {
511 case BOOL:
512 return "tf", nil
513 case BYTE:
514 return "i8", nil
515 case I16:
516 return "i16", nil
517 case I32:
518 return "i32", nil
519 case I64:
520 return "i64", nil
521 case DOUBLE:
522 return "dbl", nil
523 case STRING:
524 return "str", nil
525 case STRUCT:
526 return "rec", nil
527 case MAP:
528 return "map", nil
529 case SET:
530 return "set", nil
531 case LIST:
532 return "lst", nil
533 case UUID:
534 return "uid", nil
535 }
536
537 e := fmt.Errorf("Unknown fieldType: %d", int(fieldType))
538 return "", NewTProtocolExceptionWithType(INVALID_DATA, e)
539}
540
541func (p *TJSONProtocol) StringToTypeId(fieldType string) (TType, error) {
542 switch fieldType {

Callers 3

WriteFieldBeginMethod · 0.95
WriteMapBeginMethod · 0.95
OutputElemListBeginMethod · 0.95

Calls 1

Tested by

no test coverage detected