示例#1
0
func (p *LogEntry) WriteField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("message", thrift.STRING, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "message", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Message))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "message", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "message", p.ThriftName(), err)
	}
	return err
}
示例#2
0
func (p *LogEntry) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("category", thrift.STRING, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "category", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Category))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "category", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "category", p.ThriftName(), err)
	}
	return err
}