| // Autogenerated by Thrift Compiler (0.13.0) |
| // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| |
| package rpc |
| |
| import ( |
| "bytes" |
| "context" |
| "database/sql/driver" |
| "errors" |
| "fmt" |
| "github.com/apache/thrift/lib/go/thrift" |
| "reflect" |
| ) |
| |
| // (needed to ensure safety because of naive import list construction.) |
| var _ = thrift.ZERO |
| var _ = fmt.Printf |
| var _ = context.Background |
| var _ = reflect.DeepEqual |
| var _ = bytes.Equal |
| |
| type TSProtocolVersion int64 |
| |
| const ( |
| TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V1 TSProtocolVersion = 0 |
| TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V2 TSProtocolVersion = 1 |
| TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V3 TSProtocolVersion = 2 |
| ) |
| |
| func (p TSProtocolVersion) String() string { |
| switch p { |
| case TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V1: |
| return "IOTDB_SERVICE_PROTOCOL_V1" |
| case TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V2: |
| return "IOTDB_SERVICE_PROTOCOL_V2" |
| case TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V3: |
| return "IOTDB_SERVICE_PROTOCOL_V3" |
| } |
| return "<UNSET>" |
| } |
| |
| func TSProtocolVersionFromString(s string) (TSProtocolVersion, error) { |
| switch s { |
| case "IOTDB_SERVICE_PROTOCOL_V1": |
| return TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V1, nil |
| case "IOTDB_SERVICE_PROTOCOL_V2": |
| return TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V2, nil |
| case "IOTDB_SERVICE_PROTOCOL_V3": |
| return TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V3, nil |
| } |
| return TSProtocolVersion(0), fmt.Errorf("not a valid TSProtocolVersion string") |
| } |
| |
| func TSProtocolVersionPtr(v TSProtocolVersion) *TSProtocolVersion { return &v } |
| |
| func (p TSProtocolVersion) MarshalText() ([]byte, error) { |
| return []byte(p.String()), nil |
| } |
| |
| func (p *TSProtocolVersion) UnmarshalText(text []byte) error { |
| q, err := TSProtocolVersionFromString(string(text)) |
| if err != nil { |
| return err |
| } |
| *p = q |
| return nil |
| } |
| |
| func (p *TSProtocolVersion) Scan(value interface{}) error { |
| v, ok := value.(int64) |
| if !ok { |
| return errors.New("Scan value is not int64") |
| } |
| *p = TSProtocolVersion(v) |
| return nil |
| } |
| |
| func (p *TSProtocolVersion) Value() (driver.Value, error) { |
| if p == nil { |
| return nil, nil |
| } |
| return int64(*p), nil |
| } |
| |
| // Attributes: |
| // - IP |
| // - Port |
| type EndPoint struct { |
| IP string `thrift:"ip,1,required" db:"ip" json:"ip"` |
| Port int32 `thrift:"port,2,required" db:"port" json:"port"` |
| } |
| |
| func NewEndPoint() *EndPoint { |
| return &EndPoint{} |
| } |
| |
| func (p *EndPoint) GetIP() string { |
| return p.IP |
| } |
| |
| func (p *EndPoint) GetPort() int32 { |
| return p.Port |
| } |
| func (p *EndPoint) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetIP bool = false |
| var issetPort bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetIP = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetPort = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetIP { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IP is not set")) |
| } |
| if !issetPort { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Port is not set")) |
| } |
| return nil |
| } |
| |
| func (p *EndPoint) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.IP = v |
| } |
| return nil |
| } |
| |
| func (p *EndPoint) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.Port = v |
| } |
| return nil |
| } |
| |
| func (p *EndPoint) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("EndPoint"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *EndPoint) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("ip", thrift.STRING, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ip: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.IP)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.ip (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ip: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *EndPoint) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.Port)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *EndPoint) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("EndPoint(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Code |
| // - Message |
| // - SubStatus |
| // - RedirectNode |
| type TSStatus struct { |
| Code int32 `thrift:"code,1,required" db:"code" json:"code"` |
| Message *string `thrift:"message,2" db:"message" json:"message,omitempty"` |
| SubStatus []*TSStatus `thrift:"subStatus,3" db:"subStatus" json:"subStatus,omitempty"` |
| RedirectNode *EndPoint `thrift:"redirectNode,4" db:"redirectNode" json:"redirectNode,omitempty"` |
| } |
| |
| func NewTSStatus() *TSStatus { |
| return &TSStatus{} |
| } |
| |
| func (p *TSStatus) GetCode() int32 { |
| return p.Code |
| } |
| |
| var TSStatus_Message_DEFAULT string |
| |
| func (p *TSStatus) GetMessage() string { |
| if !p.IsSetMessage() { |
| return TSStatus_Message_DEFAULT |
| } |
| return *p.Message |
| } |
| |
| var TSStatus_SubStatus_DEFAULT []*TSStatus |
| |
| func (p *TSStatus) GetSubStatus() []*TSStatus { |
| return p.SubStatus |
| } |
| |
| var TSStatus_RedirectNode_DEFAULT *EndPoint |
| |
| func (p *TSStatus) GetRedirectNode() *EndPoint { |
| if !p.IsSetRedirectNode() { |
| return TSStatus_RedirectNode_DEFAULT |
| } |
| return p.RedirectNode |
| } |
| func (p *TSStatus) IsSetMessage() bool { |
| return p.Message != nil |
| } |
| |
| func (p *TSStatus) IsSetSubStatus() bool { |
| return p.SubStatus != nil |
| } |
| |
| func (p *TSStatus) IsSetRedirectNode() bool { |
| return p.RedirectNode != nil |
| } |
| |
| func (p *TSStatus) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetCode bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetCode = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetCode { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSStatus) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.Code = v |
| } |
| return nil |
| } |
| |
| func (p *TSStatus) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.Message = &v |
| } |
| return nil |
| } |
| |
| func (p *TSStatus) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]*TSStatus, 0, size) |
| p.SubStatus = tSlice |
| for i := 0; i < size; i++ { |
| _elem0 := &TSStatus{} |
| if err := _elem0.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) |
| } |
| p.SubStatus = append(p.SubStatus, _elem0) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSStatus) ReadField4(iprot thrift.TProtocol) error { |
| p.RedirectNode = &EndPoint{} |
| if err := p.RedirectNode.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RedirectNode), err) |
| } |
| return nil |
| } |
| |
| func (p *TSStatus) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSStatus"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSStatus) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.Code)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSStatus) writeField2(oprot thrift.TProtocol) (err error) { |
| if p.IsSetMessage() { |
| if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:message: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.Message)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.message (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:message: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSStatus) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSubStatus() { |
| if err := oprot.WriteFieldBegin("subStatus", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:subStatus: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SubStatus)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.SubStatus { |
| if err := v.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:subStatus: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSStatus) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetRedirectNode() { |
| if err := oprot.WriteFieldBegin("redirectNode", thrift.STRUCT, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:redirectNode: ", p), err) |
| } |
| if err := p.RedirectNode.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RedirectNode), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:redirectNode: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSStatus) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSStatus(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Time |
| // - ValueList |
| // - BitmapList |
| type TSQueryDataSet struct { |
| Time []byte `thrift:"time,1,required" db:"time" json:"time"` |
| ValueList [][]byte `thrift:"valueList,2,required" db:"valueList" json:"valueList"` |
| BitmapList [][]byte `thrift:"bitmapList,3,required" db:"bitmapList" json:"bitmapList"` |
| } |
| |
| func NewTSQueryDataSet() *TSQueryDataSet { |
| return &TSQueryDataSet{} |
| } |
| |
| func (p *TSQueryDataSet) GetTime() []byte { |
| return p.Time |
| } |
| |
| func (p *TSQueryDataSet) GetValueList() [][]byte { |
| return p.ValueList |
| } |
| |
| func (p *TSQueryDataSet) GetBitmapList() [][]byte { |
| return p.BitmapList |
| } |
| func (p *TSQueryDataSet) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetTime bool = false |
| var issetValueList bool = false |
| var issetBitmapList bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetTime = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetValueList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetBitmapList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetTime { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Time is not set")) |
| } |
| if !issetValueList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueList is not set")) |
| } |
| if !issetBitmapList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BitmapList is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryDataSet) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.Time = v |
| } |
| return nil |
| } |
| |
| func (p *TSQueryDataSet) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.ValueList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem1 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem1 = v |
| } |
| p.ValueList = append(p.ValueList, _elem1) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryDataSet) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.BitmapList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem2 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem2 = v |
| } |
| p.BitmapList = append(p.BitmapList, _elem2) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryDataSet) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSQueryDataSet"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryDataSet) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("time", thrift.STRING, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:time: ", p), err) |
| } |
| if err := oprot.WriteBinary(p.Time); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.time (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:time: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSQueryDataSet) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("valueList", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.ValueList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ValueList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSQueryDataSet) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("bitmapList", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:bitmapList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.BitmapList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.BitmapList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:bitmapList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSQueryDataSet) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSQueryDataSet(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - TimeList |
| // - ValueList |
| type TSQueryNonAlignDataSet struct { |
| TimeList [][]byte `thrift:"timeList,1,required" db:"timeList" json:"timeList"` |
| ValueList [][]byte `thrift:"valueList,2,required" db:"valueList" json:"valueList"` |
| } |
| |
| func NewTSQueryNonAlignDataSet() *TSQueryNonAlignDataSet { |
| return &TSQueryNonAlignDataSet{} |
| } |
| |
| func (p *TSQueryNonAlignDataSet) GetTimeList() [][]byte { |
| return p.TimeList |
| } |
| |
| func (p *TSQueryNonAlignDataSet) GetValueList() [][]byte { |
| return p.ValueList |
| } |
| func (p *TSQueryNonAlignDataSet) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetTimeList bool = false |
| var issetValueList bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetTimeList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetValueList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetTimeList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimeList is not set")) |
| } |
| if !issetValueList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueList is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryNonAlignDataSet) ReadField1(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.TimeList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem3 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem3 = v |
| } |
| p.TimeList = append(p.TimeList, _elem3) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryNonAlignDataSet) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.ValueList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem4 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem4 = v |
| } |
| p.ValueList = append(p.ValueList, _elem4) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryNonAlignDataSet) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSQueryNonAlignDataSet"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSQueryNonAlignDataSet) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timeList", thrift.LIST, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timeList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.TimeList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.TimeList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timeList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSQueryNonAlignDataSet) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("valueList", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.ValueList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ValueList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSQueryNonAlignDataSet) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSQueryNonAlignDataSet(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Status |
| // - QueryId |
| // - Columns |
| // - OperationType |
| // - IgnoreTimeStamp |
| // - DataTypeList |
| // - QueryDataSet |
| // - NonAlignQueryDataSet |
| // - ColumnNameIndexMap |
| type TSExecuteStatementResp struct { |
| Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"` |
| QueryId *int64 `thrift:"queryId,2" db:"queryId" json:"queryId,omitempty"` |
| Columns []string `thrift:"columns,3" db:"columns" json:"columns,omitempty"` |
| OperationType *string `thrift:"operationType,4" db:"operationType" json:"operationType,omitempty"` |
| IgnoreTimeStamp *bool `thrift:"ignoreTimeStamp,5" db:"ignoreTimeStamp" json:"ignoreTimeStamp,omitempty"` |
| DataTypeList []string `thrift:"dataTypeList,6" db:"dataTypeList" json:"dataTypeList,omitempty"` |
| QueryDataSet *TSQueryDataSet `thrift:"queryDataSet,7" db:"queryDataSet" json:"queryDataSet,omitempty"` |
| NonAlignQueryDataSet *TSQueryNonAlignDataSet `thrift:"nonAlignQueryDataSet,8" db:"nonAlignQueryDataSet" json:"nonAlignQueryDataSet,omitempty"` |
| ColumnNameIndexMap map[string]int32 `thrift:"columnNameIndexMap,9" db:"columnNameIndexMap" json:"columnNameIndexMap,omitempty"` |
| } |
| |
| func NewTSExecuteStatementResp() *TSExecuteStatementResp { |
| return &TSExecuteStatementResp{} |
| } |
| |
| var TSExecuteStatementResp_Status_DEFAULT *TSStatus |
| |
| func (p *TSExecuteStatementResp) GetStatus() *TSStatus { |
| if !p.IsSetStatus() { |
| return TSExecuteStatementResp_Status_DEFAULT |
| } |
| return p.Status |
| } |
| |
| var TSExecuteStatementResp_QueryId_DEFAULT int64 |
| |
| func (p *TSExecuteStatementResp) GetQueryId() int64 { |
| if !p.IsSetQueryId() { |
| return TSExecuteStatementResp_QueryId_DEFAULT |
| } |
| return *p.QueryId |
| } |
| |
| var TSExecuteStatementResp_Columns_DEFAULT []string |
| |
| func (p *TSExecuteStatementResp) GetColumns() []string { |
| return p.Columns |
| } |
| |
| var TSExecuteStatementResp_OperationType_DEFAULT string |
| |
| func (p *TSExecuteStatementResp) GetOperationType() string { |
| if !p.IsSetOperationType() { |
| return TSExecuteStatementResp_OperationType_DEFAULT |
| } |
| return *p.OperationType |
| } |
| |
| var TSExecuteStatementResp_IgnoreTimeStamp_DEFAULT bool |
| |
| func (p *TSExecuteStatementResp) GetIgnoreTimeStamp() bool { |
| if !p.IsSetIgnoreTimeStamp() { |
| return TSExecuteStatementResp_IgnoreTimeStamp_DEFAULT |
| } |
| return *p.IgnoreTimeStamp |
| } |
| |
| var TSExecuteStatementResp_DataTypeList_DEFAULT []string |
| |
| func (p *TSExecuteStatementResp) GetDataTypeList() []string { |
| return p.DataTypeList |
| } |
| |
| var TSExecuteStatementResp_QueryDataSet_DEFAULT *TSQueryDataSet |
| |
| func (p *TSExecuteStatementResp) GetQueryDataSet() *TSQueryDataSet { |
| if !p.IsSetQueryDataSet() { |
| return TSExecuteStatementResp_QueryDataSet_DEFAULT |
| } |
| return p.QueryDataSet |
| } |
| |
| var TSExecuteStatementResp_NonAlignQueryDataSet_DEFAULT *TSQueryNonAlignDataSet |
| |
| func (p *TSExecuteStatementResp) GetNonAlignQueryDataSet() *TSQueryNonAlignDataSet { |
| if !p.IsSetNonAlignQueryDataSet() { |
| return TSExecuteStatementResp_NonAlignQueryDataSet_DEFAULT |
| } |
| return p.NonAlignQueryDataSet |
| } |
| |
| var TSExecuteStatementResp_ColumnNameIndexMap_DEFAULT map[string]int32 |
| |
| func (p *TSExecuteStatementResp) GetColumnNameIndexMap() map[string]int32 { |
| return p.ColumnNameIndexMap |
| } |
| func (p *TSExecuteStatementResp) IsSetStatus() bool { |
| return p.Status != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetQueryId() bool { |
| return p.QueryId != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetColumns() bool { |
| return p.Columns != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetOperationType() bool { |
| return p.OperationType != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetIgnoreTimeStamp() bool { |
| return p.IgnoreTimeStamp != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetDataTypeList() bool { |
| return p.DataTypeList != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetQueryDataSet() bool { |
| return p.QueryDataSet != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetNonAlignQueryDataSet() bool { |
| return p.NonAlignQueryDataSet != nil |
| } |
| |
| func (p *TSExecuteStatementResp) IsSetColumnNameIndexMap() bool { |
| return p.ColumnNameIndexMap != nil |
| } |
| |
| func (p *TSExecuteStatementResp) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetStatus bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetStatus = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.BOOL { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 7: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField7(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 8: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField8(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 9: |
| if fieldTypeId == thrift.MAP { |
| if err := p.ReadField9(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetStatus { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField1(iprot thrift.TProtocol) error { |
| p.Status = &TSStatus{} |
| if err := p.Status.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.QueryId = &v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Columns = tSlice |
| for i := 0; i < size; i++ { |
| var _elem5 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem5 = v |
| } |
| p.Columns = append(p.Columns, _elem5) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.OperationType = &v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBool(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.IgnoreTimeStamp = &v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField6(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.DataTypeList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem6 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem6 = v |
| } |
| p.DataTypeList = append(p.DataTypeList, _elem6) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField7(iprot thrift.TProtocol) error { |
| p.QueryDataSet = &TSQueryDataSet{} |
| if err := p.QueryDataSet.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.QueryDataSet), err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField8(iprot thrift.TProtocol) error { |
| p.NonAlignQueryDataSet = &TSQueryNonAlignDataSet{} |
| if err := p.NonAlignQueryDataSet.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NonAlignQueryDataSet), err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) ReadField9(iprot thrift.TProtocol) error { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]int32, size) |
| p.ColumnNameIndexMap = tMap |
| for i := 0; i < size; i++ { |
| var _key7 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key7 = v |
| } |
| var _val8 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val8 = v |
| } |
| p.ColumnNameIndexMap[_key7] = _val8 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSExecuteStatementResp"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField7(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField8(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField9(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementResp) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) |
| } |
| if err := p.Status.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField2(oprot thrift.TProtocol) (err error) { |
| if p.IsSetQueryId() { |
| if err := oprot.WriteFieldBegin("queryId", thrift.I64, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(*p.QueryId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetColumns() { |
| if err := oprot.WriteFieldBegin("columns", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Columns)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Columns { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetOperationType() { |
| if err := oprot.WriteFieldBegin("operationType", thrift.STRING, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:operationType: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.OperationType)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.operationType (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:operationType: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField5(oprot thrift.TProtocol) (err error) { |
| if p.IsSetIgnoreTimeStamp() { |
| if err := oprot.WriteFieldBegin("ignoreTimeStamp", thrift.BOOL, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignoreTimeStamp: ", p), err) |
| } |
| if err := oprot.WriteBool(bool(*p.IgnoreTimeStamp)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.ignoreTimeStamp (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignoreTimeStamp: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField6(oprot thrift.TProtocol) (err error) { |
| if p.IsSetDataTypeList() { |
| if err := oprot.WriteFieldBegin("dataTypeList", thrift.LIST, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dataTypeList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.DataTypeList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.DataTypeList { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dataTypeList: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField7(oprot thrift.TProtocol) (err error) { |
| if p.IsSetQueryDataSet() { |
| if err := oprot.WriteFieldBegin("queryDataSet", thrift.STRUCT, 7); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:queryDataSet: ", p), err) |
| } |
| if err := p.QueryDataSet.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.QueryDataSet), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 7:queryDataSet: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField8(oprot thrift.TProtocol) (err error) { |
| if p.IsSetNonAlignQueryDataSet() { |
| if err := oprot.WriteFieldBegin("nonAlignQueryDataSet", thrift.STRUCT, 8); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:nonAlignQueryDataSet: ", p), err) |
| } |
| if err := p.NonAlignQueryDataSet.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NonAlignQueryDataSet), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 8:nonAlignQueryDataSet: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) writeField9(oprot thrift.TProtocol) (err error) { |
| if p.IsSetColumnNameIndexMap() { |
| if err := oprot.WriteFieldBegin("columnNameIndexMap", thrift.MAP, 9); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:columnNameIndexMap: ", p), err) |
| } |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.ColumnNameIndexMap)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range p.ColumnNameIndexMap { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 9:columnNameIndexMap: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementResp) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSExecuteStatementResp(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Status |
| // - ServerProtocolVersion |
| // - SessionId |
| // - Configuration |
| type TSOpenSessionResp struct { |
| Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"` |
| ServerProtocolVersion TSProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"` |
| SessionId *int64 `thrift:"sessionId,3" db:"sessionId" json:"sessionId,omitempty"` |
| Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` |
| } |
| |
| func NewTSOpenSessionResp() *TSOpenSessionResp { |
| return &TSOpenSessionResp{ |
| ServerProtocolVersion: 0, |
| } |
| } |
| |
| var TSOpenSessionResp_Status_DEFAULT *TSStatus |
| |
| func (p *TSOpenSessionResp) GetStatus() *TSStatus { |
| if !p.IsSetStatus() { |
| return TSOpenSessionResp_Status_DEFAULT |
| } |
| return p.Status |
| } |
| |
| func (p *TSOpenSessionResp) GetServerProtocolVersion() TSProtocolVersion { |
| return p.ServerProtocolVersion |
| } |
| |
| var TSOpenSessionResp_SessionId_DEFAULT int64 |
| |
| func (p *TSOpenSessionResp) GetSessionId() int64 { |
| if !p.IsSetSessionId() { |
| return TSOpenSessionResp_SessionId_DEFAULT |
| } |
| return *p.SessionId |
| } |
| |
| var TSOpenSessionResp_Configuration_DEFAULT map[string]string |
| |
| func (p *TSOpenSessionResp) GetConfiguration() map[string]string { |
| return p.Configuration |
| } |
| func (p *TSOpenSessionResp) IsSetStatus() bool { |
| return p.Status != nil |
| } |
| |
| func (p *TSOpenSessionResp) IsSetSessionId() bool { |
| return p.SessionId != nil |
| } |
| |
| func (p *TSOpenSessionResp) IsSetConfiguration() bool { |
| return p.Configuration != nil |
| } |
| |
| func (p *TSOpenSessionResp) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetStatus bool = false |
| var issetServerProtocolVersion bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetStatus = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetServerProtocolVersion = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.MAP { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetStatus { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) |
| } |
| if !issetServerProtocolVersion { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionResp) ReadField1(iprot thrift.TProtocol) error { |
| p.Status = &TSStatus{} |
| if err := p.Status.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionResp) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| temp := TSProtocolVersion(v) |
| p.ServerProtocolVersion = temp |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionResp) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.SessionId = &v |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionResp) ReadField4(iprot thrift.TProtocol) error { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| p.Configuration = tMap |
| for i := 0; i < size; i++ { |
| var _key9 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key9 = v |
| } |
| var _val10 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val10 = v |
| } |
| p.Configuration[_key9] = _val10 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionResp) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSOpenSessionResp"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionResp) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) |
| } |
| if err := p.Status.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionResp) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("serverProtocolVersion", thrift.I32, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.ServerProtocolVersion)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionResp) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSessionId() { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(*p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionId: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionResp) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetConfiguration() { |
| if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) |
| } |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range p.Configuration { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionResp) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSOpenSessionResp(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - ClientProtocol |
| // - ZoneId |
| // - Username |
| // - Password |
| // - Configuration |
| type TSOpenSessionReq struct { |
| ClientProtocol TSProtocolVersion `thrift:"client_protocol,1,required" db:"client_protocol" json:"client_protocol"` |
| ZoneId string `thrift:"zoneId,2,required" db:"zoneId" json:"zoneId"` |
| Username *string `thrift:"username,3" db:"username" json:"username,omitempty"` |
| Password *string `thrift:"password,4" db:"password" json:"password,omitempty"` |
| Configuration map[string]string `thrift:"configuration,5" db:"configuration" json:"configuration,omitempty"` |
| } |
| |
| func NewTSOpenSessionReq() *TSOpenSessionReq { |
| return &TSOpenSessionReq{ |
| ClientProtocol: 2, |
| } |
| } |
| |
| func (p *TSOpenSessionReq) GetClientProtocol() TSProtocolVersion { |
| return p.ClientProtocol |
| } |
| |
| func (p *TSOpenSessionReq) GetZoneId() string { |
| return p.ZoneId |
| } |
| |
| var TSOpenSessionReq_Username_DEFAULT string |
| |
| func (p *TSOpenSessionReq) GetUsername() string { |
| if !p.IsSetUsername() { |
| return TSOpenSessionReq_Username_DEFAULT |
| } |
| return *p.Username |
| } |
| |
| var TSOpenSessionReq_Password_DEFAULT string |
| |
| func (p *TSOpenSessionReq) GetPassword() string { |
| if !p.IsSetPassword() { |
| return TSOpenSessionReq_Password_DEFAULT |
| } |
| return *p.Password |
| } |
| |
| var TSOpenSessionReq_Configuration_DEFAULT map[string]string |
| |
| func (p *TSOpenSessionReq) GetConfiguration() map[string]string { |
| return p.Configuration |
| } |
| func (p *TSOpenSessionReq) IsSetUsername() bool { |
| return p.Username != nil |
| } |
| |
| func (p *TSOpenSessionReq) IsSetPassword() bool { |
| return p.Password != nil |
| } |
| |
| func (p *TSOpenSessionReq) IsSetConfiguration() bool { |
| return p.Configuration != nil |
| } |
| |
| func (p *TSOpenSessionReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetClientProtocol bool = false |
| var issetZoneId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetClientProtocol = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetZoneId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.MAP { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetClientProtocol { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientProtocol is not set")) |
| } |
| if !issetZoneId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ZoneId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| temp := TSProtocolVersion(v) |
| p.ClientProtocol = temp |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.ZoneId = v |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.Username = &v |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.Password = &v |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) ReadField5(iprot thrift.TProtocol) error { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| p.Configuration = tMap |
| for i := 0; i < size; i++ { |
| var _key11 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key11 = v |
| } |
| var _val12 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val12 = v |
| } |
| p.Configuration[_key11] = _val12 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSOpenSessionReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSOpenSessionReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("client_protocol", thrift.I32, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.ClientProtocol)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("zoneId", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zoneId: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.ZoneId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.zoneId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zoneId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetUsername() { |
| if err := oprot.WriteFieldBegin("username", thrift.STRING, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:username: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.Username)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.username (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:username: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetPassword() { |
| if err := oprot.WriteFieldBegin("password", thrift.STRING, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:password: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.Password)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.password (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:password: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if p.IsSetConfiguration() { |
| if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:configuration: ", p), err) |
| } |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range p.Configuration { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:configuration: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSOpenSessionReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSOpenSessionReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| type TSCloseSessionReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| } |
| |
| func NewTSCloseSessionReq() *TSCloseSessionReq { |
| return &TSCloseSessionReq{} |
| } |
| |
| func (p *TSCloseSessionReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| func (p *TSCloseSessionReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSCloseSessionReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSCloseSessionReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSCloseSessionReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCloseSessionReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCloseSessionReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSCloseSessionReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Statement |
| // - StatementId |
| // - FetchSize |
| // - Timeout |
| type TSExecuteStatementReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` |
| StatementId int64 `thrift:"statementId,3,required" db:"statementId" json:"statementId"` |
| FetchSize *int32 `thrift:"fetchSize,4" db:"fetchSize" json:"fetchSize,omitempty"` |
| Timeout *int64 `thrift:"timeout,5" db:"timeout" json:"timeout,omitempty"` |
| } |
| |
| func NewTSExecuteStatementReq() *TSExecuteStatementReq { |
| return &TSExecuteStatementReq{} |
| } |
| |
| func (p *TSExecuteStatementReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSExecuteStatementReq) GetStatement() string { |
| return p.Statement |
| } |
| |
| func (p *TSExecuteStatementReq) GetStatementId() int64 { |
| return p.StatementId |
| } |
| |
| var TSExecuteStatementReq_FetchSize_DEFAULT int32 |
| |
| func (p *TSExecuteStatementReq) GetFetchSize() int32 { |
| if !p.IsSetFetchSize() { |
| return TSExecuteStatementReq_FetchSize_DEFAULT |
| } |
| return *p.FetchSize |
| } |
| |
| var TSExecuteStatementReq_Timeout_DEFAULT int64 |
| |
| func (p *TSExecuteStatementReq) GetTimeout() int64 { |
| if !p.IsSetTimeout() { |
| return TSExecuteStatementReq_Timeout_DEFAULT |
| } |
| return *p.Timeout |
| } |
| func (p *TSExecuteStatementReq) IsSetFetchSize() bool { |
| return p.FetchSize != nil |
| } |
| |
| func (p *TSExecuteStatementReq) IsSetTimeout() bool { |
| return p.Timeout != nil |
| } |
| |
| func (p *TSExecuteStatementReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetStatement bool = false |
| var issetStatementId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetStatement = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetStatementId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetStatement { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set")) |
| } |
| if !issetStatementId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatementId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.Statement = v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.StatementId = v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.FetchSize = &v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.Timeout = &v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSExecuteStatementReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteStatementReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("statement", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.Statement)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("statementId", thrift.I64, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statementId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.StatementId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.statementId (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statementId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetFetchSize() { |
| if err := oprot.WriteFieldBegin("fetchSize", thrift.I32, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchSize: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(*p.FetchSize)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.fetchSize (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchSize: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if p.IsSetTimeout() { |
| if err := oprot.WriteFieldBegin("timeout", thrift.I64, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timeout: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(*p.Timeout)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timeout (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timeout: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSExecuteStatementReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSExecuteStatementReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Statements |
| type TSExecuteBatchStatementReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Statements []string `thrift:"statements,2,required" db:"statements" json:"statements"` |
| } |
| |
| func NewTSExecuteBatchStatementReq() *TSExecuteBatchStatementReq { |
| return &TSExecuteBatchStatementReq{} |
| } |
| |
| func (p *TSExecuteBatchStatementReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSExecuteBatchStatementReq) GetStatements() []string { |
| return p.Statements |
| } |
| func (p *TSExecuteBatchStatementReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetStatements bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetStatements = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetStatements { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statements is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteBatchStatementReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteBatchStatementReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Statements = tSlice |
| for i := 0; i < size; i++ { |
| var _elem13 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem13 = v |
| } |
| p.Statements = append(p.Statements, _elem13) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteBatchStatementReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSExecuteBatchStatementReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSExecuteBatchStatementReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSExecuteBatchStatementReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("statements", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statements: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Statements)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Statements { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statements: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSExecuteBatchStatementReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSExecuteBatchStatementReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - QueryId |
| type TSGetOperationStatusReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| QueryId int64 `thrift:"queryId,2,required" db:"queryId" json:"queryId"` |
| } |
| |
| func NewTSGetOperationStatusReq() *TSGetOperationStatusReq { |
| return &TSGetOperationStatusReq{} |
| } |
| |
| func (p *TSGetOperationStatusReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSGetOperationStatusReq) GetQueryId() int64 { |
| return p.QueryId |
| } |
| func (p *TSGetOperationStatusReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetQueryId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetQueryId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetQueryId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSGetOperationStatusReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSGetOperationStatusReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.QueryId = v |
| } |
| return nil |
| } |
| |
| func (p *TSGetOperationStatusReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSGetOperationStatusReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSGetOperationStatusReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSGetOperationStatusReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("queryId", thrift.I64, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.QueryId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSGetOperationStatusReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSGetOperationStatusReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - QueryId |
| type TSCancelOperationReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| QueryId int64 `thrift:"queryId,2,required" db:"queryId" json:"queryId"` |
| } |
| |
| func NewTSCancelOperationReq() *TSCancelOperationReq { |
| return &TSCancelOperationReq{} |
| } |
| |
| func (p *TSCancelOperationReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSCancelOperationReq) GetQueryId() int64 { |
| return p.QueryId |
| } |
| func (p *TSCancelOperationReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetQueryId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetQueryId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetQueryId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSCancelOperationReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSCancelOperationReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.QueryId = v |
| } |
| return nil |
| } |
| |
| func (p *TSCancelOperationReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSCancelOperationReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCancelOperationReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCancelOperationReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("queryId", thrift.I64, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.QueryId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCancelOperationReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSCancelOperationReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - QueryId |
| // - StatementId |
| type TSCloseOperationReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| QueryId *int64 `thrift:"queryId,2" db:"queryId" json:"queryId,omitempty"` |
| StatementId *int64 `thrift:"statementId,3" db:"statementId" json:"statementId,omitempty"` |
| } |
| |
| func NewTSCloseOperationReq() *TSCloseOperationReq { |
| return &TSCloseOperationReq{} |
| } |
| |
| func (p *TSCloseOperationReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| var TSCloseOperationReq_QueryId_DEFAULT int64 |
| |
| func (p *TSCloseOperationReq) GetQueryId() int64 { |
| if !p.IsSetQueryId() { |
| return TSCloseOperationReq_QueryId_DEFAULT |
| } |
| return *p.QueryId |
| } |
| |
| var TSCloseOperationReq_StatementId_DEFAULT int64 |
| |
| func (p *TSCloseOperationReq) GetStatementId() int64 { |
| if !p.IsSetStatementId() { |
| return TSCloseOperationReq_StatementId_DEFAULT |
| } |
| return *p.StatementId |
| } |
| func (p *TSCloseOperationReq) IsSetQueryId() bool { |
| return p.QueryId != nil |
| } |
| |
| func (p *TSCloseOperationReq) IsSetStatementId() bool { |
| return p.StatementId != nil |
| } |
| |
| func (p *TSCloseOperationReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSCloseOperationReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSCloseOperationReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.QueryId = &v |
| } |
| return nil |
| } |
| |
| func (p *TSCloseOperationReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.StatementId = &v |
| } |
| return nil |
| } |
| |
| func (p *TSCloseOperationReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSCloseOperationReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCloseOperationReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCloseOperationReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if p.IsSetQueryId() { |
| if err := oprot.WriteFieldBegin("queryId", thrift.I64, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(*p.QueryId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCloseOperationReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetStatementId() { |
| if err := oprot.WriteFieldBegin("statementId", thrift.I64, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statementId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(*p.StatementId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.statementId (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statementId: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCloseOperationReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSCloseOperationReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Statement |
| // - FetchSize |
| // - QueryId |
| // - IsAlign |
| // - Timeout |
| type TSFetchResultsReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` |
| FetchSize int32 `thrift:"fetchSize,3,required" db:"fetchSize" json:"fetchSize"` |
| QueryId int64 `thrift:"queryId,4,required" db:"queryId" json:"queryId"` |
| IsAlign bool `thrift:"isAlign,5,required" db:"isAlign" json:"isAlign"` |
| Timeout int64 `thrift:"timeout,6,required" db:"timeout" json:"timeout"` |
| } |
| |
| func NewTSFetchResultsReq() *TSFetchResultsReq { |
| return &TSFetchResultsReq{} |
| } |
| |
| func (p *TSFetchResultsReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSFetchResultsReq) GetStatement() string { |
| return p.Statement |
| } |
| |
| func (p *TSFetchResultsReq) GetFetchSize() int32 { |
| return p.FetchSize |
| } |
| |
| func (p *TSFetchResultsReq) GetQueryId() int64 { |
| return p.QueryId |
| } |
| |
| func (p *TSFetchResultsReq) GetIsAlign() bool { |
| return p.IsAlign |
| } |
| |
| func (p *TSFetchResultsReq) GetTimeout() int64 { |
| return p.Timeout |
| } |
| func (p *TSFetchResultsReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetStatement bool = false |
| var issetFetchSize bool = false |
| var issetQueryId bool = false |
| var issetIsAlign bool = false |
| var issetTimeout bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetStatement = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetFetchSize = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetQueryId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.BOOL { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetIsAlign = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| issetTimeout = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetStatement { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set")) |
| } |
| if !issetFetchSize { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FetchSize is not set")) |
| } |
| if !issetQueryId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set")) |
| } |
| if !issetIsAlign { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsAlign is not set")) |
| } |
| if !issetTimeout { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timeout is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.Statement = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.FetchSize = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.QueryId = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBool(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.IsAlign = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) ReadField6(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 6: ", err) |
| } else { |
| p.Timeout = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSFetchResultsReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("statement", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.Statement)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("fetchSize", thrift.I32, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fetchSize: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.FetchSize)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.fetchSize (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fetchSize: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("queryId", thrift.I64, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:queryId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.QueryId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.queryId (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:queryId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("isAlign", thrift.BOOL, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:isAlign: ", p), err) |
| } |
| if err := oprot.WriteBool(bool(p.IsAlign)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.isAlign (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:isAlign: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsReq) writeField6(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timeout", thrift.I64, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:timeout: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.Timeout)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timeout (6) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:timeout: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSFetchResultsReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Status |
| // - HasResultSet |
| // - IsAlign |
| // - QueryDataSet |
| // - NonAlignQueryDataSet |
| type TSFetchResultsResp struct { |
| Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"` |
| HasResultSet bool `thrift:"hasResultSet,2,required" db:"hasResultSet" json:"hasResultSet"` |
| IsAlign bool `thrift:"isAlign,3,required" db:"isAlign" json:"isAlign"` |
| QueryDataSet *TSQueryDataSet `thrift:"queryDataSet,4" db:"queryDataSet" json:"queryDataSet,omitempty"` |
| NonAlignQueryDataSet *TSQueryNonAlignDataSet `thrift:"nonAlignQueryDataSet,5" db:"nonAlignQueryDataSet" json:"nonAlignQueryDataSet,omitempty"` |
| } |
| |
| func NewTSFetchResultsResp() *TSFetchResultsResp { |
| return &TSFetchResultsResp{} |
| } |
| |
| var TSFetchResultsResp_Status_DEFAULT *TSStatus |
| |
| func (p *TSFetchResultsResp) GetStatus() *TSStatus { |
| if !p.IsSetStatus() { |
| return TSFetchResultsResp_Status_DEFAULT |
| } |
| return p.Status |
| } |
| |
| func (p *TSFetchResultsResp) GetHasResultSet() bool { |
| return p.HasResultSet |
| } |
| |
| func (p *TSFetchResultsResp) GetIsAlign() bool { |
| return p.IsAlign |
| } |
| |
| var TSFetchResultsResp_QueryDataSet_DEFAULT *TSQueryDataSet |
| |
| func (p *TSFetchResultsResp) GetQueryDataSet() *TSQueryDataSet { |
| if !p.IsSetQueryDataSet() { |
| return TSFetchResultsResp_QueryDataSet_DEFAULT |
| } |
| return p.QueryDataSet |
| } |
| |
| var TSFetchResultsResp_NonAlignQueryDataSet_DEFAULT *TSQueryNonAlignDataSet |
| |
| func (p *TSFetchResultsResp) GetNonAlignQueryDataSet() *TSQueryNonAlignDataSet { |
| if !p.IsSetNonAlignQueryDataSet() { |
| return TSFetchResultsResp_NonAlignQueryDataSet_DEFAULT |
| } |
| return p.NonAlignQueryDataSet |
| } |
| func (p *TSFetchResultsResp) IsSetStatus() bool { |
| return p.Status != nil |
| } |
| |
| func (p *TSFetchResultsResp) IsSetQueryDataSet() bool { |
| return p.QueryDataSet != nil |
| } |
| |
| func (p *TSFetchResultsResp) IsSetNonAlignQueryDataSet() bool { |
| return p.NonAlignQueryDataSet != nil |
| } |
| |
| func (p *TSFetchResultsResp) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetStatus bool = false |
| var issetHasResultSet bool = false |
| var issetIsAlign bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetStatus = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.BOOL { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetHasResultSet = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.BOOL { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetIsAlign = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetStatus { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) |
| } |
| if !issetHasResultSet { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set")) |
| } |
| if !issetIsAlign { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsAlign is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) ReadField1(iprot thrift.TProtocol) error { |
| p.Status = &TSStatus{} |
| if err := p.Status.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBool(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.HasResultSet = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBool(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.IsAlign = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) ReadField4(iprot thrift.TProtocol) error { |
| p.QueryDataSet = &TSQueryDataSet{} |
| if err := p.QueryDataSet.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.QueryDataSet), err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) ReadField5(iprot thrift.TProtocol) error { |
| p.NonAlignQueryDataSet = &TSQueryNonAlignDataSet{} |
| if err := p.NonAlignQueryDataSet.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NonAlignQueryDataSet), err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSFetchResultsResp"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchResultsResp) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) |
| } |
| if err := p.Status.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsResp) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("hasResultSet", thrift.BOOL, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasResultSet: ", p), err) |
| } |
| if err := oprot.WriteBool(bool(p.HasResultSet)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasResultSet: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsResp) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("isAlign", thrift.BOOL, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:isAlign: ", p), err) |
| } |
| if err := oprot.WriteBool(bool(p.IsAlign)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.isAlign (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:isAlign: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsResp) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetQueryDataSet() { |
| if err := oprot.WriteFieldBegin("queryDataSet", thrift.STRUCT, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:queryDataSet: ", p), err) |
| } |
| if err := p.QueryDataSet.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.QueryDataSet), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:queryDataSet: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsResp) writeField5(oprot thrift.TProtocol) (err error) { |
| if p.IsSetNonAlignQueryDataSet() { |
| if err := oprot.WriteFieldBegin("nonAlignQueryDataSet", thrift.STRUCT, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nonAlignQueryDataSet: ", p), err) |
| } |
| if err := p.NonAlignQueryDataSet.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NonAlignQueryDataSet), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nonAlignQueryDataSet: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSFetchResultsResp) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSFetchResultsResp(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Status |
| // - MetadataInJson |
| // - ColumnsList |
| // - DataType |
| type TSFetchMetadataResp struct { |
| Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"` |
| MetadataInJson *string `thrift:"metadataInJson,2" db:"metadataInJson" json:"metadataInJson,omitempty"` |
| ColumnsList []string `thrift:"columnsList,3" db:"columnsList" json:"columnsList,omitempty"` |
| DataType *string `thrift:"dataType,4" db:"dataType" json:"dataType,omitempty"` |
| } |
| |
| func NewTSFetchMetadataResp() *TSFetchMetadataResp { |
| return &TSFetchMetadataResp{} |
| } |
| |
| var TSFetchMetadataResp_Status_DEFAULT *TSStatus |
| |
| func (p *TSFetchMetadataResp) GetStatus() *TSStatus { |
| if !p.IsSetStatus() { |
| return TSFetchMetadataResp_Status_DEFAULT |
| } |
| return p.Status |
| } |
| |
| var TSFetchMetadataResp_MetadataInJson_DEFAULT string |
| |
| func (p *TSFetchMetadataResp) GetMetadataInJson() string { |
| if !p.IsSetMetadataInJson() { |
| return TSFetchMetadataResp_MetadataInJson_DEFAULT |
| } |
| return *p.MetadataInJson |
| } |
| |
| var TSFetchMetadataResp_ColumnsList_DEFAULT []string |
| |
| func (p *TSFetchMetadataResp) GetColumnsList() []string { |
| return p.ColumnsList |
| } |
| |
| var TSFetchMetadataResp_DataType_DEFAULT string |
| |
| func (p *TSFetchMetadataResp) GetDataType() string { |
| if !p.IsSetDataType() { |
| return TSFetchMetadataResp_DataType_DEFAULT |
| } |
| return *p.DataType |
| } |
| func (p *TSFetchMetadataResp) IsSetStatus() bool { |
| return p.Status != nil |
| } |
| |
| func (p *TSFetchMetadataResp) IsSetMetadataInJson() bool { |
| return p.MetadataInJson != nil |
| } |
| |
| func (p *TSFetchMetadataResp) IsSetColumnsList() bool { |
| return p.ColumnsList != nil |
| } |
| |
| func (p *TSFetchMetadataResp) IsSetDataType() bool { |
| return p.DataType != nil |
| } |
| |
| func (p *TSFetchMetadataResp) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetStatus bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetStatus = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetStatus { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataResp) ReadField1(iprot thrift.TProtocol) error { |
| p.Status = &TSStatus{} |
| if err := p.Status.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataResp) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.MetadataInJson = &v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataResp) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.ColumnsList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem14 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem14 = v |
| } |
| p.ColumnsList = append(p.ColumnsList, _elem14) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataResp) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.DataType = &v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataResp) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSFetchMetadataResp"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataResp) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) |
| } |
| if err := p.Status.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataResp) writeField2(oprot thrift.TProtocol) (err error) { |
| if p.IsSetMetadataInJson() { |
| if err := oprot.WriteFieldBegin("metadataInJson", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:metadataInJson: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.MetadataInJson)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.metadataInJson (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:metadataInJson: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataResp) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetColumnsList() { |
| if err := oprot.WriteFieldBegin("columnsList", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columnsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.ColumnsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ColumnsList { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columnsList: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataResp) writeField4(oprot thrift.TProtocol) (err error) { |
| if p.IsSetDataType() { |
| if err := oprot.WriteFieldBegin("dataType", thrift.STRING, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:dataType: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.DataType)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.dataType (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dataType: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataResp) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSFetchMetadataResp(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Type |
| // - ColumnPath |
| type TSFetchMetadataReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Type string `thrift:"type,2,required" db:"type" json:"type"` |
| ColumnPath *string `thrift:"columnPath,3" db:"columnPath" json:"columnPath,omitempty"` |
| } |
| |
| func NewTSFetchMetadataReq() *TSFetchMetadataReq { |
| return &TSFetchMetadataReq{} |
| } |
| |
| func (p *TSFetchMetadataReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSFetchMetadataReq) GetType() string { |
| return p.Type |
| } |
| |
| var TSFetchMetadataReq_ColumnPath_DEFAULT string |
| |
| func (p *TSFetchMetadataReq) GetColumnPath() string { |
| if !p.IsSetColumnPath() { |
| return TSFetchMetadataReq_ColumnPath_DEFAULT |
| } |
| return *p.ColumnPath |
| } |
| func (p *TSFetchMetadataReq) IsSetColumnPath() bool { |
| return p.ColumnPath != nil |
| } |
| |
| func (p *TSFetchMetadataReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetType bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetType = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetType { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.Type = v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.ColumnPath = &v |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSFetchMetadataReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSFetchMetadataReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("type", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.Type)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetColumnPath() { |
| if err := oprot.WriteFieldBegin("columnPath", thrift.STRING, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columnPath: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.ColumnPath)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.columnPath (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columnPath: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSFetchMetadataReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSFetchMetadataReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Status |
| // - TimeZone |
| type TSGetTimeZoneResp struct { |
| Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"` |
| TimeZone string `thrift:"timeZone,2,required" db:"timeZone" json:"timeZone"` |
| } |
| |
| func NewTSGetTimeZoneResp() *TSGetTimeZoneResp { |
| return &TSGetTimeZoneResp{} |
| } |
| |
| var TSGetTimeZoneResp_Status_DEFAULT *TSStatus |
| |
| func (p *TSGetTimeZoneResp) GetStatus() *TSStatus { |
| if !p.IsSetStatus() { |
| return TSGetTimeZoneResp_Status_DEFAULT |
| } |
| return p.Status |
| } |
| |
| func (p *TSGetTimeZoneResp) GetTimeZone() string { |
| return p.TimeZone |
| } |
| func (p *TSGetTimeZoneResp) IsSetStatus() bool { |
| return p.Status != nil |
| } |
| |
| func (p *TSGetTimeZoneResp) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetStatus bool = false |
| var issetTimeZone bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetStatus = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetTimeZone = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetStatus { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) |
| } |
| if !issetTimeZone { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimeZone is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSGetTimeZoneResp) ReadField1(iprot thrift.TProtocol) error { |
| p.Status = &TSStatus{} |
| if err := p.Status.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) |
| } |
| return nil |
| } |
| |
| func (p *TSGetTimeZoneResp) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.TimeZone = v |
| } |
| return nil |
| } |
| |
| func (p *TSGetTimeZoneResp) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSGetTimeZoneResp"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSGetTimeZoneResp) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) |
| } |
| if err := p.Status.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSGetTimeZoneResp) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timeZone", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:timeZone: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.TimeZone)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timeZone (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:timeZone: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSGetTimeZoneResp) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSGetTimeZoneResp(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - TimeZone |
| type TSSetTimeZoneReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| TimeZone string `thrift:"timeZone,2,required" db:"timeZone" json:"timeZone"` |
| } |
| |
| func NewTSSetTimeZoneReq() *TSSetTimeZoneReq { |
| return &TSSetTimeZoneReq{} |
| } |
| |
| func (p *TSSetTimeZoneReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSSetTimeZoneReq) GetTimeZone() string { |
| return p.TimeZone |
| } |
| func (p *TSSetTimeZoneReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetTimeZone bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetTimeZone = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetTimeZone { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimeZone is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSSetTimeZoneReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSSetTimeZoneReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.TimeZone = v |
| } |
| return nil |
| } |
| |
| func (p *TSSetTimeZoneReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSSetTimeZoneReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSSetTimeZoneReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSSetTimeZoneReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timeZone", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:timeZone: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.TimeZone)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timeZone (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:timeZone: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSSetTimeZoneReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSSetTimeZoneReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceId |
| // - Measurements |
| // - Values |
| // - Timestamp |
| type TSInsertRecordReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceId string `thrift:"deviceId,2,required" db:"deviceId" json:"deviceId"` |
| Measurements []string `thrift:"measurements,3,required" db:"measurements" json:"measurements"` |
| Values []byte `thrift:"values,4,required" db:"values" json:"values"` |
| Timestamp int64 `thrift:"timestamp,5,required" db:"timestamp" json:"timestamp"` |
| } |
| |
| func NewTSInsertRecordReq() *TSInsertRecordReq { |
| return &TSInsertRecordReq{} |
| } |
| |
| func (p *TSInsertRecordReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertRecordReq) GetDeviceId() string { |
| return p.DeviceId |
| } |
| |
| func (p *TSInsertRecordReq) GetMeasurements() []string { |
| return p.Measurements |
| } |
| |
| func (p *TSInsertRecordReq) GetValues() []byte { |
| return p.Values |
| } |
| |
| func (p *TSInsertRecordReq) GetTimestamp() int64 { |
| return p.Timestamp |
| } |
| func (p *TSInsertRecordReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceId bool = false |
| var issetMeasurements bool = false |
| var issetValues bool = false |
| var issetTimestamp bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurements = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValues = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestamp = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceId is not set")) |
| } |
| if !issetMeasurements { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Measurements is not set")) |
| } |
| if !issetValues { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) |
| } |
| if !issetTimestamp { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamp is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.DeviceId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Measurements = tSlice |
| for i := 0; i < size; i++ { |
| var _elem15 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem15 = v |
| } |
| p.Measurements = append(p.Measurements, _elem15) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.Values = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.Timestamp = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertRecordReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceId", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceId: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.DeviceId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.deviceId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurements", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurements: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Measurements)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Measurements { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurements: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("values", thrift.STRING, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:values: ", p), err) |
| } |
| if err := oprot.WriteBinary(p.Values); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.values (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:values: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestamp: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.Timestamp)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timestamp (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestamp: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertRecordReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceId |
| // - Measurements |
| // - Values |
| // - Timestamp |
| type TSInsertStringRecordReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceId string `thrift:"deviceId,2,required" db:"deviceId" json:"deviceId"` |
| Measurements []string `thrift:"measurements,3,required" db:"measurements" json:"measurements"` |
| Values []string `thrift:"values,4,required" db:"values" json:"values"` |
| Timestamp int64 `thrift:"timestamp,5,required" db:"timestamp" json:"timestamp"` |
| } |
| |
| func NewTSInsertStringRecordReq() *TSInsertStringRecordReq { |
| return &TSInsertStringRecordReq{} |
| } |
| |
| func (p *TSInsertStringRecordReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertStringRecordReq) GetDeviceId() string { |
| return p.DeviceId |
| } |
| |
| func (p *TSInsertStringRecordReq) GetMeasurements() []string { |
| return p.Measurements |
| } |
| |
| func (p *TSInsertStringRecordReq) GetValues() []string { |
| return p.Values |
| } |
| |
| func (p *TSInsertStringRecordReq) GetTimestamp() int64 { |
| return p.Timestamp |
| } |
| func (p *TSInsertStringRecordReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceId bool = false |
| var issetMeasurements bool = false |
| var issetValues bool = false |
| var issetTimestamp bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurements = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValues = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestamp = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceId is not set")) |
| } |
| if !issetMeasurements { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Measurements is not set")) |
| } |
| if !issetValues { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) |
| } |
| if !issetTimestamp { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamp is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.DeviceId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Measurements = tSlice |
| for i := 0; i < size; i++ { |
| var _elem16 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem16 = v |
| } |
| p.Measurements = append(p.Measurements, _elem16) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) ReadField4(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Values = tSlice |
| for i := 0; i < size; i++ { |
| var _elem17 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem17 = v |
| } |
| p.Values = append(p.Values, _elem17) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.Timestamp = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertStringRecordReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceId", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceId: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.DeviceId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.deviceId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurements", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurements: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Measurements)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Measurements { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurements: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("values", thrift.LIST, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:values: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Values { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:values: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestamp: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.Timestamp)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timestamp (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestamp: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertStringRecordReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceId |
| // - Measurements |
| // - Values |
| // - Timestamps |
| // - Types |
| // - Size |
| type TSInsertTabletReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceId string `thrift:"deviceId,2,required" db:"deviceId" json:"deviceId"` |
| Measurements []string `thrift:"measurements,3,required" db:"measurements" json:"measurements"` |
| Values []byte `thrift:"values,4,required" db:"values" json:"values"` |
| Timestamps []byte `thrift:"timestamps,5,required" db:"timestamps" json:"timestamps"` |
| Types []int32 `thrift:"types,6,required" db:"types" json:"types"` |
| Size int32 `thrift:"size,7,required" db:"size" json:"size"` |
| } |
| |
| func NewTSInsertTabletReq() *TSInsertTabletReq { |
| return &TSInsertTabletReq{} |
| } |
| |
| func (p *TSInsertTabletReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertTabletReq) GetDeviceId() string { |
| return p.DeviceId |
| } |
| |
| func (p *TSInsertTabletReq) GetMeasurements() []string { |
| return p.Measurements |
| } |
| |
| func (p *TSInsertTabletReq) GetValues() []byte { |
| return p.Values |
| } |
| |
| func (p *TSInsertTabletReq) GetTimestamps() []byte { |
| return p.Timestamps |
| } |
| |
| func (p *TSInsertTabletReq) GetTypes() []int32 { |
| return p.Types |
| } |
| |
| func (p *TSInsertTabletReq) GetSize() int32 { |
| return p.Size |
| } |
| func (p *TSInsertTabletReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceId bool = false |
| var issetMeasurements bool = false |
| var issetValues bool = false |
| var issetTimestamps bool = false |
| var issetTypes bool = false |
| var issetSize bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurements = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValues = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestamps = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| issetTypes = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 7: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField7(iprot); err != nil { |
| return err |
| } |
| issetSize = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceId is not set")) |
| } |
| if !issetMeasurements { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Measurements is not set")) |
| } |
| if !issetValues { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) |
| } |
| if !issetTimestamps { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamps is not set")) |
| } |
| if !issetTypes { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Types is not set")) |
| } |
| if !issetSize { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Size is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.DeviceId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Measurements = tSlice |
| for i := 0; i < size; i++ { |
| var _elem18 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem18 = v |
| } |
| p.Measurements = append(p.Measurements, _elem18) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.Values = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.Timestamps = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField6(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int32, 0, size) |
| p.Types = tSlice |
| for i := 0; i < size; i++ { |
| var _elem19 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem19 = v |
| } |
| p.Types = append(p.Types, _elem19) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) ReadField7(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 7: ", err) |
| } else { |
| p.Size = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertTabletReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField7(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceId", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceId: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.DeviceId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.deviceId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurements", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurements: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Measurements)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Measurements { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurements: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("values", thrift.STRING, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:values: ", p), err) |
| } |
| if err := oprot.WriteBinary(p.Values); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.values (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:values: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestamps", thrift.STRING, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestamps: ", p), err) |
| } |
| if err := oprot.WriteBinary(p.Timestamps); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timestamps (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestamps: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) writeField6(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("types", thrift.LIST, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:types: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I32, len(p.Types)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Types { |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:types: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) writeField7(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("size", thrift.I32, 7); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:size: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.Size)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.size (7) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 7:size: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertTabletReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceIds |
| // - MeasurementsList |
| // - ValuesList |
| // - TimestampsList |
| // - TypesList |
| // - SizeList |
| type TSInsertTabletsReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceIds []string `thrift:"deviceIds,2,required" db:"deviceIds" json:"deviceIds"` |
| MeasurementsList [][]string `thrift:"measurementsList,3,required" db:"measurementsList" json:"measurementsList"` |
| ValuesList [][]byte `thrift:"valuesList,4,required" db:"valuesList" json:"valuesList"` |
| TimestampsList [][]byte `thrift:"timestampsList,5,required" db:"timestampsList" json:"timestampsList"` |
| TypesList [][]int32 `thrift:"typesList,6,required" db:"typesList" json:"typesList"` |
| SizeList []int32 `thrift:"sizeList,7,required" db:"sizeList" json:"sizeList"` |
| } |
| |
| func NewTSInsertTabletsReq() *TSInsertTabletsReq { |
| return &TSInsertTabletsReq{} |
| } |
| |
| func (p *TSInsertTabletsReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertTabletsReq) GetDeviceIds() []string { |
| return p.DeviceIds |
| } |
| |
| func (p *TSInsertTabletsReq) GetMeasurementsList() [][]string { |
| return p.MeasurementsList |
| } |
| |
| func (p *TSInsertTabletsReq) GetValuesList() [][]byte { |
| return p.ValuesList |
| } |
| |
| func (p *TSInsertTabletsReq) GetTimestampsList() [][]byte { |
| return p.TimestampsList |
| } |
| |
| func (p *TSInsertTabletsReq) GetTypesList() [][]int32 { |
| return p.TypesList |
| } |
| |
| func (p *TSInsertTabletsReq) GetSizeList() []int32 { |
| return p.SizeList |
| } |
| func (p *TSInsertTabletsReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceIds bool = false |
| var issetMeasurementsList bool = false |
| var issetValuesList bool = false |
| var issetTimestampsList bool = false |
| var issetTypesList bool = false |
| var issetSizeList bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceIds = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurementsList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValuesList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestampsList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| issetTypesList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 7: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField7(iprot); err != nil { |
| return err |
| } |
| issetSizeList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceIds { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceIds is not set")) |
| } |
| if !issetMeasurementsList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MeasurementsList is not set")) |
| } |
| if !issetValuesList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValuesList is not set")) |
| } |
| if !issetTimestampsList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimestampsList is not set")) |
| } |
| if !issetTypesList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypesList is not set")) |
| } |
| if !issetSizeList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SizeList is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.DeviceIds = tSlice |
| for i := 0; i < size; i++ { |
| var _elem20 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem20 = v |
| } |
| p.DeviceIds = append(p.DeviceIds, _elem20) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]string, 0, size) |
| p.MeasurementsList = tSlice |
| for i := 0; i < size; i++ { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| _elem21 := tSlice |
| for i := 0; i < size; i++ { |
| var _elem22 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem22 = v |
| } |
| _elem21 = append(_elem21, _elem22) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| p.MeasurementsList = append(p.MeasurementsList, _elem21) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField4(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.ValuesList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem23 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem23 = v |
| } |
| p.ValuesList = append(p.ValuesList, _elem23) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField5(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.TimestampsList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem24 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem24 = v |
| } |
| p.TimestampsList = append(p.TimestampsList, _elem24) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField6(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]int32, 0, size) |
| p.TypesList = tSlice |
| for i := 0; i < size; i++ { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int32, 0, size) |
| _elem25 := tSlice |
| for i := 0; i < size; i++ { |
| var _elem26 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem26 = v |
| } |
| _elem25 = append(_elem25, _elem26) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| p.TypesList = append(p.TypesList, _elem25) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) ReadField7(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int32, 0, size) |
| p.SizeList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem27 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem27 = v |
| } |
| p.SizeList = append(p.SizeList, _elem27) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertTabletsReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField7(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertTabletsReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceIds", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceIds: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.DeviceIds)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.DeviceIds { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceIds: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurementsList", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurementsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.LIST, len(p.MeasurementsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.MeasurementsList { |
| if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range v { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurementsList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("valuesList", thrift.LIST, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:valuesList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.ValuesList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ValuesList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:valuesList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestampsList", thrift.LIST, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestampsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.TimestampsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.TimestampsList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestampsList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) writeField6(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("typesList", thrift.LIST, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:typesList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.LIST, len(p.TypesList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.TypesList { |
| if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range v { |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:typesList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) writeField7(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sizeList", thrift.LIST, 7); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:sizeList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I32, len(p.SizeList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.SizeList { |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 7:sizeList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertTabletsReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertTabletsReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceIds |
| // - MeasurementsList |
| // - ValuesList |
| // - Timestamps |
| type TSInsertRecordsReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceIds []string `thrift:"deviceIds,2,required" db:"deviceIds" json:"deviceIds"` |
| MeasurementsList [][]string `thrift:"measurementsList,3,required" db:"measurementsList" json:"measurementsList"` |
| ValuesList [][]byte `thrift:"valuesList,4,required" db:"valuesList" json:"valuesList"` |
| Timestamps []int64 `thrift:"timestamps,5,required" db:"timestamps" json:"timestamps"` |
| } |
| |
| func NewTSInsertRecordsReq() *TSInsertRecordsReq { |
| return &TSInsertRecordsReq{} |
| } |
| |
| func (p *TSInsertRecordsReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertRecordsReq) GetDeviceIds() []string { |
| return p.DeviceIds |
| } |
| |
| func (p *TSInsertRecordsReq) GetMeasurementsList() [][]string { |
| return p.MeasurementsList |
| } |
| |
| func (p *TSInsertRecordsReq) GetValuesList() [][]byte { |
| return p.ValuesList |
| } |
| |
| func (p *TSInsertRecordsReq) GetTimestamps() []int64 { |
| return p.Timestamps |
| } |
| func (p *TSInsertRecordsReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceIds bool = false |
| var issetMeasurementsList bool = false |
| var issetValuesList bool = false |
| var issetTimestamps bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceIds = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurementsList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValuesList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestamps = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceIds { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceIds is not set")) |
| } |
| if !issetMeasurementsList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MeasurementsList is not set")) |
| } |
| if !issetValuesList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValuesList is not set")) |
| } |
| if !issetTimestamps { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamps is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.DeviceIds = tSlice |
| for i := 0; i < size; i++ { |
| var _elem28 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem28 = v |
| } |
| p.DeviceIds = append(p.DeviceIds, _elem28) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]string, 0, size) |
| p.MeasurementsList = tSlice |
| for i := 0; i < size; i++ { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| _elem29 := tSlice |
| for i := 0; i < size; i++ { |
| var _elem30 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem30 = v |
| } |
| _elem29 = append(_elem29, _elem30) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| p.MeasurementsList = append(p.MeasurementsList, _elem29) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) ReadField4(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.ValuesList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem31 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem31 = v |
| } |
| p.ValuesList = append(p.ValuesList, _elem31) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) ReadField5(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int64, 0, size) |
| p.Timestamps = tSlice |
| for i := 0; i < size; i++ { |
| var _elem32 int64 |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem32 = v |
| } |
| p.Timestamps = append(p.Timestamps, _elem32) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertRecordsReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceIds", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceIds: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.DeviceIds)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.DeviceIds { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceIds: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurementsList", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurementsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.LIST, len(p.MeasurementsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.MeasurementsList { |
| if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range v { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurementsList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("valuesList", thrift.LIST, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:valuesList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.ValuesList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ValuesList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:valuesList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestamps", thrift.LIST, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestamps: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I64, len(p.Timestamps)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Timestamps { |
| if err := oprot.WriteI64(int64(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestamps: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertRecordsReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceId |
| // - MeasurementsList |
| // - ValuesList |
| // - Timestamps |
| type TSInsertRecordsOfOneDeviceReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceId string `thrift:"deviceId,2,required" db:"deviceId" json:"deviceId"` |
| MeasurementsList [][]string `thrift:"measurementsList,3,required" db:"measurementsList" json:"measurementsList"` |
| ValuesList [][]byte `thrift:"valuesList,4,required" db:"valuesList" json:"valuesList"` |
| Timestamps []int64 `thrift:"timestamps,5,required" db:"timestamps" json:"timestamps"` |
| } |
| |
| func NewTSInsertRecordsOfOneDeviceReq() *TSInsertRecordsOfOneDeviceReq { |
| return &TSInsertRecordsOfOneDeviceReq{} |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) GetDeviceId() string { |
| return p.DeviceId |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) GetMeasurementsList() [][]string { |
| return p.MeasurementsList |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) GetValuesList() [][]byte { |
| return p.ValuesList |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) GetTimestamps() []int64 { |
| return p.Timestamps |
| } |
| func (p *TSInsertRecordsOfOneDeviceReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceId bool = false |
| var issetMeasurementsList bool = false |
| var issetValuesList bool = false |
| var issetTimestamps bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurementsList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValuesList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestamps = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceId is not set")) |
| } |
| if !issetMeasurementsList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MeasurementsList is not set")) |
| } |
| if !issetValuesList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValuesList is not set")) |
| } |
| if !issetTimestamps { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamps is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.DeviceId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]string, 0, size) |
| p.MeasurementsList = tSlice |
| for i := 0; i < size; i++ { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| _elem33 := tSlice |
| for i := 0; i < size; i++ { |
| var _elem34 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem34 = v |
| } |
| _elem33 = append(_elem33, _elem34) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| p.MeasurementsList = append(p.MeasurementsList, _elem33) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) ReadField4(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]byte, 0, size) |
| p.ValuesList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem35 []byte |
| if v, err := iprot.ReadBinary(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem35 = v |
| } |
| p.ValuesList = append(p.ValuesList, _elem35) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) ReadField5(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int64, 0, size) |
| p.Timestamps = tSlice |
| for i := 0; i < size; i++ { |
| var _elem36 int64 |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem36 = v |
| } |
| p.Timestamps = append(p.Timestamps, _elem36) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertRecordsOfOneDeviceReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceId", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceId: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.DeviceId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.deviceId (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurementsList", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurementsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.LIST, len(p.MeasurementsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.MeasurementsList { |
| if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range v { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurementsList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("valuesList", thrift.LIST, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:valuesList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.ValuesList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ValuesList { |
| if err := oprot.WriteBinary(v); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:valuesList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestamps", thrift.LIST, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestamps: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I64, len(p.Timestamps)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Timestamps { |
| if err := oprot.WriteI64(int64(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestamps: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertRecordsOfOneDeviceReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertRecordsOfOneDeviceReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - DeviceIds |
| // - MeasurementsList |
| // - ValuesList |
| // - Timestamps |
| type TSInsertStringRecordsReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| DeviceIds []string `thrift:"deviceIds,2,required" db:"deviceIds" json:"deviceIds"` |
| MeasurementsList [][]string `thrift:"measurementsList,3,required" db:"measurementsList" json:"measurementsList"` |
| ValuesList [][]string `thrift:"valuesList,4,required" db:"valuesList" json:"valuesList"` |
| Timestamps []int64 `thrift:"timestamps,5,required" db:"timestamps" json:"timestamps"` |
| } |
| |
| func NewTSInsertStringRecordsReq() *TSInsertStringRecordsReq { |
| return &TSInsertStringRecordsReq{} |
| } |
| |
| func (p *TSInsertStringRecordsReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSInsertStringRecordsReq) GetDeviceIds() []string { |
| return p.DeviceIds |
| } |
| |
| func (p *TSInsertStringRecordsReq) GetMeasurementsList() [][]string { |
| return p.MeasurementsList |
| } |
| |
| func (p *TSInsertStringRecordsReq) GetValuesList() [][]string { |
| return p.ValuesList |
| } |
| |
| func (p *TSInsertStringRecordsReq) GetTimestamps() []int64 { |
| return p.Timestamps |
| } |
| func (p *TSInsertStringRecordsReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetDeviceIds bool = false |
| var issetMeasurementsList bool = false |
| var issetValuesList bool = false |
| var issetTimestamps bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetDeviceIds = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetMeasurementsList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetValuesList = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetTimestamps = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetDeviceIds { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DeviceIds is not set")) |
| } |
| if !issetMeasurementsList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MeasurementsList is not set")) |
| } |
| if !issetValuesList { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValuesList is not set")) |
| } |
| if !issetTimestamps { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamps is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.DeviceIds = tSlice |
| for i := 0; i < size; i++ { |
| var _elem37 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem37 = v |
| } |
| p.DeviceIds = append(p.DeviceIds, _elem37) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]string, 0, size) |
| p.MeasurementsList = tSlice |
| for i := 0; i < size; i++ { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| _elem38 := tSlice |
| for i := 0; i < size; i++ { |
| var _elem39 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem39 = v |
| } |
| _elem38 = append(_elem38, _elem39) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| p.MeasurementsList = append(p.MeasurementsList, _elem38) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) ReadField4(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([][]string, 0, size) |
| p.ValuesList = tSlice |
| for i := 0; i < size; i++ { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| _elem40 := tSlice |
| for i := 0; i < size; i++ { |
| var _elem41 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem41 = v |
| } |
| _elem40 = append(_elem40, _elem41) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| p.ValuesList = append(p.ValuesList, _elem40) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) ReadField5(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int64, 0, size) |
| p.Timestamps = tSlice |
| for i := 0; i < size; i++ { |
| var _elem42 int64 |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem42 = v |
| } |
| p.Timestamps = append(p.Timestamps, _elem42) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSInsertStringRecordsReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSInsertStringRecordsReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordsReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("deviceIds", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deviceIds: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.DeviceIds)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.DeviceIds { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deviceIds: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordsReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("measurementsList", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:measurementsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.LIST, len(p.MeasurementsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.MeasurementsList { |
| if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range v { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:measurementsList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordsReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("valuesList", thrift.LIST, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:valuesList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.LIST, len(p.ValuesList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.ValuesList { |
| if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range v { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:valuesList: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordsReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestamps", thrift.LIST, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timestamps: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I64, len(p.Timestamps)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Timestamps { |
| if err := oprot.WriteI64(int64(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timestamps: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSInsertStringRecordsReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSInsertStringRecordsReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Paths |
| // - StartTime |
| // - EndTime |
| type TSDeleteDataReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Paths []string `thrift:"paths,2,required" db:"paths" json:"paths"` |
| StartTime int64 `thrift:"startTime,3,required" db:"startTime" json:"startTime"` |
| EndTime int64 `thrift:"endTime,4,required" db:"endTime" json:"endTime"` |
| } |
| |
| func NewTSDeleteDataReq() *TSDeleteDataReq { |
| return &TSDeleteDataReq{} |
| } |
| |
| func (p *TSDeleteDataReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSDeleteDataReq) GetPaths() []string { |
| return p.Paths |
| } |
| |
| func (p *TSDeleteDataReq) GetStartTime() int64 { |
| return p.StartTime |
| } |
| |
| func (p *TSDeleteDataReq) GetEndTime() int64 { |
| return p.EndTime |
| } |
| func (p *TSDeleteDataReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetPaths bool = false |
| var issetStartTime bool = false |
| var issetEndTime bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetPaths = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetStartTime = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetEndTime = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetPaths { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Paths is not set")) |
| } |
| if !issetStartTime { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) |
| } |
| if !issetEndTime { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field EndTime is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSDeleteDataReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSDeleteDataReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Paths = tSlice |
| for i := 0; i < size; i++ { |
| var _elem43 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem43 = v |
| } |
| p.Paths = append(p.Paths, _elem43) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSDeleteDataReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.StartTime = v |
| } |
| return nil |
| } |
| |
| func (p *TSDeleteDataReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.EndTime = v |
| } |
| return nil |
| } |
| |
| func (p *TSDeleteDataReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSDeleteDataReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSDeleteDataReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSDeleteDataReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("paths", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:paths: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Paths)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Paths { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:paths: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSDeleteDataReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("startTime", thrift.I64, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:startTime: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.StartTime)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.startTime (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:startTime: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSDeleteDataReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("endTime", thrift.I64, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:endTime: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.EndTime)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.endTime (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:endTime: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSDeleteDataReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSDeleteDataReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Path |
| // - DataType |
| // - Encoding |
| // - Compressor |
| // - Props |
| // - Tags |
| // - Attributes |
| // - MeasurementAlias |
| type TSCreateTimeseriesReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Path string `thrift:"path,2,required" db:"path" json:"path"` |
| DataType int32 `thrift:"dataType,3,required" db:"dataType" json:"dataType"` |
| Encoding int32 `thrift:"encoding,4,required" db:"encoding" json:"encoding"` |
| Compressor int32 `thrift:"compressor,5,required" db:"compressor" json:"compressor"` |
| Props map[string]string `thrift:"props,6" db:"props" json:"props,omitempty"` |
| Tags map[string]string `thrift:"tags,7" db:"tags" json:"tags,omitempty"` |
| Attributes map[string]string `thrift:"attributes,8" db:"attributes" json:"attributes,omitempty"` |
| MeasurementAlias *string `thrift:"measurementAlias,9" db:"measurementAlias" json:"measurementAlias,omitempty"` |
| } |
| |
| func NewTSCreateTimeseriesReq() *TSCreateTimeseriesReq { |
| return &TSCreateTimeseriesReq{} |
| } |
| |
| func (p *TSCreateTimeseriesReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSCreateTimeseriesReq) GetPath() string { |
| return p.Path |
| } |
| |
| func (p *TSCreateTimeseriesReq) GetDataType() int32 { |
| return p.DataType |
| } |
| |
| func (p *TSCreateTimeseriesReq) GetEncoding() int32 { |
| return p.Encoding |
| } |
| |
| func (p *TSCreateTimeseriesReq) GetCompressor() int32 { |
| return p.Compressor |
| } |
| |
| var TSCreateTimeseriesReq_Props_DEFAULT map[string]string |
| |
| func (p *TSCreateTimeseriesReq) GetProps() map[string]string { |
| return p.Props |
| } |
| |
| var TSCreateTimeseriesReq_Tags_DEFAULT map[string]string |
| |
| func (p *TSCreateTimeseriesReq) GetTags() map[string]string { |
| return p.Tags |
| } |
| |
| var TSCreateTimeseriesReq_Attributes_DEFAULT map[string]string |
| |
| func (p *TSCreateTimeseriesReq) GetAttributes() map[string]string { |
| return p.Attributes |
| } |
| |
| var TSCreateTimeseriesReq_MeasurementAlias_DEFAULT string |
| |
| func (p *TSCreateTimeseriesReq) GetMeasurementAlias() string { |
| if !p.IsSetMeasurementAlias() { |
| return TSCreateTimeseriesReq_MeasurementAlias_DEFAULT |
| } |
| return *p.MeasurementAlias |
| } |
| func (p *TSCreateTimeseriesReq) IsSetProps() bool { |
| return p.Props != nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) IsSetTags() bool { |
| return p.Tags != nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) IsSetAttributes() bool { |
| return p.Attributes != nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) IsSetMeasurementAlias() bool { |
| return p.MeasurementAlias != nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetPath bool = false |
| var issetDataType bool = false |
| var issetEncoding bool = false |
| var issetCompressor bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetPath = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetDataType = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetEncoding = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetCompressor = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.MAP { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 7: |
| if fieldTypeId == thrift.MAP { |
| if err := p.ReadField7(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 8: |
| if fieldTypeId == thrift.MAP { |
| if err := p.ReadField8(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 9: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField9(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetPath { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Path is not set")) |
| } |
| if !issetDataType { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DataType is not set")) |
| } |
| if !issetEncoding { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Encoding is not set")) |
| } |
| if !issetCompressor { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Compressor is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.Path = v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.DataType = v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.Encoding = v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.Compressor = v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField6(iprot thrift.TProtocol) error { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| p.Props = tMap |
| for i := 0; i < size; i++ { |
| var _key44 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key44 = v |
| } |
| var _val45 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val45 = v |
| } |
| p.Props[_key44] = _val45 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField7(iprot thrift.TProtocol) error { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| p.Tags = tMap |
| for i := 0; i < size; i++ { |
| var _key46 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key46 = v |
| } |
| var _val47 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val47 = v |
| } |
| p.Tags[_key46] = _val47 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField8(iprot thrift.TProtocol) error { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| p.Attributes = tMap |
| for i := 0; i < size; i++ { |
| var _key48 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key48 = v |
| } |
| var _val49 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val49 = v |
| } |
| p.Attributes[_key48] = _val49 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) ReadField9(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 9: ", err) |
| } else { |
| p.MeasurementAlias = &v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSCreateTimeseriesReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField7(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField8(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField9(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:path: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.Path)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.path (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:path: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("dataType", thrift.I32, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dataType: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.DataType)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.dataType (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dataType: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("encoding", thrift.I32, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:encoding: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.Encoding)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.encoding (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:encoding: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("compressor", thrift.I32, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:compressor: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(p.Compressor)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.compressor (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:compressor: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField6(oprot thrift.TProtocol) (err error) { |
| if p.IsSetProps() { |
| if err := oprot.WriteFieldBegin("props", thrift.MAP, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:props: ", p), err) |
| } |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Props)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range p.Props { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:props: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField7(oprot thrift.TProtocol) (err error) { |
| if p.IsSetTags() { |
| if err := oprot.WriteFieldBegin("tags", thrift.MAP, 7); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:tags: ", p), err) |
| } |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Tags)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range p.Tags { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tags: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField8(oprot thrift.TProtocol) (err error) { |
| if p.IsSetAttributes() { |
| if err := oprot.WriteFieldBegin("attributes", thrift.MAP, 8); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:attributes: ", p), err) |
| } |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Attributes)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range p.Attributes { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 8:attributes: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) writeField9(oprot thrift.TProtocol) (err error) { |
| if p.IsSetMeasurementAlias() { |
| if err := oprot.WriteFieldBegin("measurementAlias", thrift.STRING, 9); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:measurementAlias: ", p), err) |
| } |
| if err := oprot.WriteString(string(*p.MeasurementAlias)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.measurementAlias (9) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 9:measurementAlias: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateTimeseriesReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSCreateTimeseriesReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Paths |
| // - FetchSize |
| // - StartTime |
| // - EndTime |
| // - StatementId |
| type TSRawDataQueryReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Paths []string `thrift:"paths,2,required" db:"paths" json:"paths"` |
| FetchSize *int32 `thrift:"fetchSize,3" db:"fetchSize" json:"fetchSize,omitempty"` |
| StartTime int64 `thrift:"startTime,4,required" db:"startTime" json:"startTime"` |
| EndTime int64 `thrift:"endTime,5,required" db:"endTime" json:"endTime"` |
| StatementId int64 `thrift:"statementId,6,required" db:"statementId" json:"statementId"` |
| } |
| |
| func NewTSRawDataQueryReq() *TSRawDataQueryReq { |
| return &TSRawDataQueryReq{} |
| } |
| |
| func (p *TSRawDataQueryReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSRawDataQueryReq) GetPaths() []string { |
| return p.Paths |
| } |
| |
| var TSRawDataQueryReq_FetchSize_DEFAULT int32 |
| |
| func (p *TSRawDataQueryReq) GetFetchSize() int32 { |
| if !p.IsSetFetchSize() { |
| return TSRawDataQueryReq_FetchSize_DEFAULT |
| } |
| return *p.FetchSize |
| } |
| |
| func (p *TSRawDataQueryReq) GetStartTime() int64 { |
| return p.StartTime |
| } |
| |
| func (p *TSRawDataQueryReq) GetEndTime() int64 { |
| return p.EndTime |
| } |
| |
| func (p *TSRawDataQueryReq) GetStatementId() int64 { |
| return p.StatementId |
| } |
| func (p *TSRawDataQueryReq) IsSetFetchSize() bool { |
| return p.FetchSize != nil |
| } |
| |
| func (p *TSRawDataQueryReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetPaths bool = false |
| var issetStartTime bool = false |
| var issetEndTime bool = false |
| var issetStatementId bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetPaths = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.I32 { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetStartTime = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetEndTime = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| issetStatementId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetPaths { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Paths is not set")) |
| } |
| if !issetStartTime { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) |
| } |
| if !issetEndTime { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field EndTime is not set")) |
| } |
| if !issetStatementId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatementId is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Paths = tSlice |
| for i := 0; i < size; i++ { |
| var _elem50 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem50 = v |
| } |
| p.Paths = append(p.Paths, _elem50) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.FetchSize = &v |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) ReadField4(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 4: ", err) |
| } else { |
| p.StartTime = v |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) ReadField5(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 5: ", err) |
| } else { |
| p.EndTime = v |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) ReadField6(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 6: ", err) |
| } else { |
| p.StatementId = v |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSRawDataQueryReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSRawDataQueryReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSRawDataQueryReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("paths", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:paths: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Paths)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Paths { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:paths: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSRawDataQueryReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if p.IsSetFetchSize() { |
| if err := oprot.WriteFieldBegin("fetchSize", thrift.I32, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fetchSize: ", p), err) |
| } |
| if err := oprot.WriteI32(int32(*p.FetchSize)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.fetchSize (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fetchSize: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSRawDataQueryReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("startTime", thrift.I64, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:startTime: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.StartTime)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.startTime (4) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:startTime: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSRawDataQueryReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("endTime", thrift.I64, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:endTime: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.EndTime)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.endTime (5) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:endTime: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSRawDataQueryReq) writeField6(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("statementId", thrift.I64, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:statementId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.StatementId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.statementId (6) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:statementId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSRawDataQueryReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSRawDataQueryReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Paths |
| // - DataTypes |
| // - Encodings |
| // - Compressors |
| // - PropsList |
| // - TagsList |
| // - AttributesList |
| // - MeasurementAliasList |
| type TSCreateMultiTimeseriesReq struct { |
| SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` |
| Paths []string `thrift:"paths,2,required" db:"paths" json:"paths"` |
| DataTypes []int32 `thrift:"dataTypes,3,required" db:"dataTypes" json:"dataTypes"` |
| Encodings []int32 `thrift:"encodings,4,required" db:"encodings" json:"encodings"` |
| Compressors []int32 `thrift:"compressors,5,required" db:"compressors" json:"compressors"` |
| PropsList []map[string]string `thrift:"propsList,6" db:"propsList" json:"propsList,omitempty"` |
| TagsList []map[string]string `thrift:"tagsList,7" db:"tagsList" json:"tagsList,omitempty"` |
| AttributesList []map[string]string `thrift:"attributesList,8" db:"attributesList" json:"attributesList,omitempty"` |
| MeasurementAliasList []string `thrift:"measurementAliasList,9" db:"measurementAliasList" json:"measurementAliasList,omitempty"` |
| } |
| |
| func NewTSCreateMultiTimeseriesReq() *TSCreateMultiTimeseriesReq { |
| return &TSCreateMultiTimeseriesReq{} |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) GetPaths() []string { |
| return p.Paths |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) GetDataTypes() []int32 { |
| return p.DataTypes |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) GetEncodings() []int32 { |
| return p.Encodings |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) GetCompressors() []int32 { |
| return p.Compressors |
| } |
| |
| var TSCreateMultiTimeseriesReq_PropsList_DEFAULT []map[string]string |
| |
| func (p *TSCreateMultiTimeseriesReq) GetPropsList() []map[string]string { |
| return p.PropsList |
| } |
| |
| var TSCreateMultiTimeseriesReq_TagsList_DEFAULT []map[string]string |
| |
| func (p *TSCreateMultiTimeseriesReq) GetTagsList() []map[string]string { |
| return p.TagsList |
| } |
| |
| var TSCreateMultiTimeseriesReq_AttributesList_DEFAULT []map[string]string |
| |
| func (p *TSCreateMultiTimeseriesReq) GetAttributesList() []map[string]string { |
| return p.AttributesList |
| } |
| |
| var TSCreateMultiTimeseriesReq_MeasurementAliasList_DEFAULT []string |
| |
| func (p *TSCreateMultiTimeseriesReq) GetMeasurementAliasList() []string { |
| return p.MeasurementAliasList |
| } |
| func (p *TSCreateMultiTimeseriesReq) IsSetPropsList() bool { |
| return p.PropsList != nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) IsSetTagsList() bool { |
| return p.TagsList != nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) IsSetAttributesList() bool { |
| return p.AttributesList != nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) IsSetMeasurementAliasList() bool { |
| return p.MeasurementAliasList != nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetSessionId bool = false |
| var issetPaths bool = false |
| var issetDataTypes bool = false |
| var issetEncodings bool = false |
| var issetCompressors bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetSessionId = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetPaths = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetDataTypes = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 4: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField4(iprot); err != nil { |
| return err |
| } |
| issetEncodings = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 5: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField5(iprot); err != nil { |
| return err |
| } |
| issetCompressors = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 6: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField6(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 7: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField7(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 8: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField8(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 9: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField9(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetSessionId { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) |
| } |
| if !issetPaths { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Paths is not set")) |
| } |
| if !issetDataTypes { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DataTypes is not set")) |
| } |
| if !issetEncodings { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Encodings is not set")) |
| } |
| if !issetCompressors { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Compressors is not set")) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Paths = tSlice |
| for i := 0; i < size; i++ { |
| var _elem51 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem51 = v |
| } |
| p.Paths = append(p.Paths, _elem51) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField3(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int32, 0, size) |
| p.DataTypes = tSlice |
| for i := 0; i < size; i++ { |
| var _elem52 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem52 = v |
| } |
| p.DataTypes = append(p.DataTypes, _elem52) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField4(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int32, 0, size) |
| p.Encodings = tSlice |
| for i := 0; i < size; i++ { |
| var _elem53 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem53 = v |
| } |
| p.Encodings = append(p.Encodings, _elem53) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField5(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]int32, 0, size) |
| p.Compressors = tSlice |
| for i := 0; i < size; i++ { |
| var _elem54 int32 |
| if v, err := iprot.ReadI32(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem54 = v |
| } |
| p.Compressors = append(p.Compressors, _elem54) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField6(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]map[string]string, 0, size) |
| p.PropsList = tSlice |
| for i := 0; i < size; i++ { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| _elem55 := tMap |
| for i := 0; i < size; i++ { |
| var _key56 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key56 = v |
| } |
| var _val57 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val57 = v |
| } |
| _elem55[_key56] = _val57 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| p.PropsList = append(p.PropsList, _elem55) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField7(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]map[string]string, 0, size) |
| p.TagsList = tSlice |
| for i := 0; i < size; i++ { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| _elem58 := tMap |
| for i := 0; i < size; i++ { |
| var _key59 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key59 = v |
| } |
| var _val60 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val60 = v |
| } |
| _elem58[_key59] = _val60 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| p.TagsList = append(p.TagsList, _elem58) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField8(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]map[string]string, 0, size) |
| p.AttributesList = tSlice |
| for i := 0; i < size; i++ { |
| _, _, size, err := iprot.ReadMapBegin() |
| if err != nil { |
| return thrift.PrependError("error reading map begin: ", err) |
| } |
| tMap := make(map[string]string, size) |
| _elem61 := tMap |
| for i := 0; i < size; i++ { |
| var _key62 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _key62 = v |
| } |
| var _val63 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _val63 = v |
| } |
| _elem61[_key62] = _val63 |
| } |
| if err := iprot.ReadMapEnd(); err != nil { |
| return thrift.PrependError("error reading map end: ", err) |
| } |
| p.AttributesList = append(p.AttributesList, _elem61) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) ReadField9(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.MeasurementAliasList = tSlice |
| for i := 0; i < size; i++ { |
| var _elem64 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem64 = v |
| } |
| p.MeasurementAliasList = append(p.MeasurementAliasList, _elem64) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("TSCreateMultiTimeseriesReq"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField4(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField5(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField6(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField7(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField8(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField9(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("paths", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:paths: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Paths)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Paths { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:paths: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("dataTypes", thrift.LIST, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dataTypes: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I32, len(p.DataTypes)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.DataTypes { |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dataTypes: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField4(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("encodings", thrift.LIST, 4); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:encodings: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I32, len(p.Encodings)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Encodings { |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 4:encodings: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField5(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("compressors", thrift.LIST, 5); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:compressors: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.I32, len(p.Compressors)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Compressors { |
| if err := oprot.WriteI32(int32(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 5:compressors: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField6(oprot thrift.TProtocol) (err error) { |
| if p.IsSetPropsList() { |
| if err := oprot.WriteFieldBegin("propsList", thrift.LIST, 6); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:propsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.MAP, len(p.PropsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.PropsList { |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range v { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 6:propsList: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField7(oprot thrift.TProtocol) (err error) { |
| if p.IsSetTagsList() { |
| if err := oprot.WriteFieldBegin("tagsList", thrift.LIST, 7); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:tagsList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.MAP, len(p.TagsList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.TagsList { |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range v { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tagsList: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField8(oprot thrift.TProtocol) (err error) { |
| if p.IsSetAttributesList() { |
| if err := oprot.WriteFieldBegin("attributesList", thrift.LIST, 8); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:attributesList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.MAP, len(p.AttributesList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.AttributesList { |
| if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil { |
| return thrift.PrependError("error writing map begin: ", err) |
| } |
| for k, v := range v { |
| if err := oprot.WriteString(string(k)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteMapEnd(); err != nil { |
| return thrift.PrependError("error writing map end: ", err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 8:attributesList: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) writeField9(oprot thrift.TProtocol) (err error) { |
| if p.IsSetMeasurementAliasList() { |
| if err := oprot.WriteFieldBegin("measurementAliasList", thrift.LIST, 9); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:measurementAliasList: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.MeasurementAliasList)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.MeasurementAliasList { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 9:measurementAliasList: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSCreateMultiTimeseriesReq) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSCreateMultiTimeseriesReq(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Version |
| // - SupportedTimeAggregationOperations |
| // - TimestampPrecision |
| type ServerProperties struct { |
| Version string `thrift:"version,1,required" db:"version" json:"version"` |
| SupportedTimeAggregationOperations []string `thrift:"supportedTimeAggregationOperations,2,required" db:"supportedTimeAggregationOperations" json:"supportedTimeAggregationOperations"` |
| TimestampPrecision string `thrift:"timestampPrecision,3,required" db:"timestampPrecision" json:"timestampPrecision"` |
| } |
| |
| func NewServerProperties() *ServerProperties { |
| return &ServerProperties{} |
| } |
| |
| func (p *ServerProperties) GetVersion() string { |
| return p.Version |
| } |
| |
| func (p *ServerProperties) GetSupportedTimeAggregationOperations() []string { |
| return p.SupportedTimeAggregationOperations |
| } |
| |
| func (p *ServerProperties) GetTimestampPrecision() string { |
| return p.TimestampPrecision |
| } |
| func (p *ServerProperties) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| var issetVersion bool = false |
| var issetSupportedTimeAggregationOperations bool = false |
| var issetTimestampPrecision bool = false |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| issetVersion = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| issetSupportedTimeAggregationOperations = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 3: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField3(iprot); err != nil { |
| return err |
| } |
| issetTimestampPrecision = true |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| if !issetVersion { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Version is not set")) |
| } |
| if !issetSupportedTimeAggregationOperations { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SupportedTimeAggregationOperations is not set")) |
| } |
| if !issetTimestampPrecision { |
| return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimestampPrecision is not set")) |
| } |
| return nil |
| } |
| |
| func (p *ServerProperties) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.Version = v |
| } |
| return nil |
| } |
| |
| func (p *ServerProperties) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.SupportedTimeAggregationOperations = tSlice |
| for i := 0; i < size; i++ { |
| var _elem65 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem65 = v |
| } |
| p.SupportedTimeAggregationOperations = append(p.SupportedTimeAggregationOperations, _elem65) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *ServerProperties) ReadField3(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 3: ", err) |
| } else { |
| p.TimestampPrecision = v |
| } |
| return nil |
| } |
| |
| func (p *ServerProperties) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("ServerProperties"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField3(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *ServerProperties) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:version: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.Version)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.version (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:version: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *ServerProperties) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("supportedTimeAggregationOperations", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:supportedTimeAggregationOperations: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.SupportedTimeAggregationOperations)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.SupportedTimeAggregationOperations { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:supportedTimeAggregationOperations: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *ServerProperties) writeField3(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("timestampPrecision", thrift.STRING, 3); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timestampPrecision: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.TimestampPrecision)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.timestampPrecision (3) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timestampPrecision: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *ServerProperties) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("ServerProperties(%+v)", *p) |
| } |
| |
| type TSIService interface { |
| // Parameters: |
| // - Req |
| OpenSession(ctx context.Context, req *TSOpenSessionReq) (r *TSOpenSessionResp, err error) |
| // Parameters: |
| // - Req |
| CloseSession(ctx context.Context, req *TSCloseSessionReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| ExecuteStatement(ctx context.Context, req *TSExecuteStatementReq) (r *TSExecuteStatementResp, err error) |
| // Parameters: |
| // - Req |
| ExecuteBatchStatement(ctx context.Context, req *TSExecuteBatchStatementReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| ExecuteQueryStatement(ctx context.Context, req *TSExecuteStatementReq) (r *TSExecuteStatementResp, err error) |
| // Parameters: |
| // - Req |
| ExecuteUpdateStatement(ctx context.Context, req *TSExecuteStatementReq) (r *TSExecuteStatementResp, err error) |
| // Parameters: |
| // - Req |
| FetchResults(ctx context.Context, req *TSFetchResultsReq) (r *TSFetchResultsResp, err error) |
| // Parameters: |
| // - Req |
| FetchMetadata(ctx context.Context, req *TSFetchMetadataReq) (r *TSFetchMetadataResp, err error) |
| // Parameters: |
| // - Req |
| CancelOperation(ctx context.Context, req *TSCancelOperationReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| CloseOperation(ctx context.Context, req *TSCloseOperationReq) (r *TSStatus, err error) |
| // Parameters: |
| // - SessionId |
| GetTimeZone(ctx context.Context, sessionId int64) (r *TSGetTimeZoneResp, err error) |
| // Parameters: |
| // - Req |
| SetTimeZone(ctx context.Context, req *TSSetTimeZoneReq) (r *TSStatus, err error) |
| GetProperties(ctx context.Context) (r *ServerProperties, err error) |
| // Parameters: |
| // - SessionId |
| // - StorageGroup |
| SetStorageGroup(ctx context.Context, sessionId int64, storageGroup string) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| CreateTimeseries(ctx context.Context, req *TSCreateTimeseriesReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| CreateMultiTimeseries(ctx context.Context, req *TSCreateMultiTimeseriesReq) (r *TSStatus, err error) |
| // Parameters: |
| // - SessionId |
| // - Path |
| DeleteTimeseries(ctx context.Context, sessionId int64, path []string) (r *TSStatus, err error) |
| // Parameters: |
| // - SessionId |
| // - StorageGroup |
| DeleteStorageGroups(ctx context.Context, sessionId int64, storageGroup []string) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertRecord(ctx context.Context, req *TSInsertRecordReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertStringRecord(ctx context.Context, req *TSInsertStringRecordReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertTablet(ctx context.Context, req *TSInsertTabletReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertTablets(ctx context.Context, req *TSInsertTabletsReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertRecords(ctx context.Context, req *TSInsertRecordsReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertRecordsOfOneDevice(ctx context.Context, req *TSInsertRecordsOfOneDeviceReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| InsertStringRecords(ctx context.Context, req *TSInsertStringRecordsReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertTablet(ctx context.Context, req *TSInsertTabletReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertTablets(ctx context.Context, req *TSInsertTabletsReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertRecord(ctx context.Context, req *TSInsertRecordReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertStringRecord(ctx context.Context, req *TSInsertStringRecordReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertRecords(ctx context.Context, req *TSInsertRecordsReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertRecordsOfOneDevice(ctx context.Context, req *TSInsertRecordsOfOneDeviceReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| TestInsertStringRecords(ctx context.Context, req *TSInsertStringRecordsReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| DeleteData(ctx context.Context, req *TSDeleteDataReq) (r *TSStatus, err error) |
| // Parameters: |
| // - Req |
| ExecuteRawDataQuery(ctx context.Context, req *TSRawDataQueryReq) (r *TSExecuteStatementResp, err error) |
| // Parameters: |
| // - SessionId |
| RequestStatementId(ctx context.Context, sessionId int64) (r int64, err error) |
| } |
| |
| type TSIServiceClient struct { |
| c thrift.TClient |
| } |
| |
| func NewTSIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TSIServiceClient { |
| return &TSIServiceClient{ |
| c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), |
| } |
| } |
| |
| func NewTSIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TSIServiceClient { |
| return &TSIServiceClient{ |
| c: thrift.NewTStandardClient(iprot, oprot), |
| } |
| } |
| |
| func NewTSIServiceClient(c thrift.TClient) *TSIServiceClient { |
| return &TSIServiceClient{ |
| c: c, |
| } |
| } |
| |
| func (p *TSIServiceClient) Client_() thrift.TClient { |
| return p.c |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) OpenSession(ctx context.Context, req *TSOpenSessionReq) (r *TSOpenSessionResp, err error) { |
| var _args66 TSIServiceOpenSessionArgs |
| _args66.Req = req |
| var _result67 TSIServiceOpenSessionResult |
| if err = p.Client_().Call(ctx, "openSession", &_args66, &_result67); err != nil { |
| return |
| } |
| return _result67.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) CloseSession(ctx context.Context, req *TSCloseSessionReq) (r *TSStatus, err error) { |
| var _args68 TSIServiceCloseSessionArgs |
| _args68.Req = req |
| var _result69 TSIServiceCloseSessionResult |
| if err = p.Client_().Call(ctx, "closeSession", &_args68, &_result69); err != nil { |
| return |
| } |
| return _result69.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) ExecuteStatement(ctx context.Context, req *TSExecuteStatementReq) (r *TSExecuteStatementResp, err error) { |
| var _args70 TSIServiceExecuteStatementArgs |
| _args70.Req = req |
| var _result71 TSIServiceExecuteStatementResult |
| if err = p.Client_().Call(ctx, "executeStatement", &_args70, &_result71); err != nil { |
| return |
| } |
| return _result71.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) ExecuteBatchStatement(ctx context.Context, req *TSExecuteBatchStatementReq) (r *TSStatus, err error) { |
| var _args72 TSIServiceExecuteBatchStatementArgs |
| _args72.Req = req |
| var _result73 TSIServiceExecuteBatchStatementResult |
| if err = p.Client_().Call(ctx, "executeBatchStatement", &_args72, &_result73); err != nil { |
| return |
| } |
| return _result73.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) ExecuteQueryStatement(ctx context.Context, req *TSExecuteStatementReq) (r *TSExecuteStatementResp, err error) { |
| var _args74 TSIServiceExecuteQueryStatementArgs |
| _args74.Req = req |
| var _result75 TSIServiceExecuteQueryStatementResult |
| if err = p.Client_().Call(ctx, "executeQueryStatement", &_args74, &_result75); err != nil { |
| return |
| } |
| return _result75.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) ExecuteUpdateStatement(ctx context.Context, req *TSExecuteStatementReq) (r *TSExecuteStatementResp, err error) { |
| var _args76 TSIServiceExecuteUpdateStatementArgs |
| _args76.Req = req |
| var _result77 TSIServiceExecuteUpdateStatementResult |
| if err = p.Client_().Call(ctx, "executeUpdateStatement", &_args76, &_result77); err != nil { |
| return |
| } |
| return _result77.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) FetchResults(ctx context.Context, req *TSFetchResultsReq) (r *TSFetchResultsResp, err error) { |
| var _args78 TSIServiceFetchResultsArgs |
| _args78.Req = req |
| var _result79 TSIServiceFetchResultsResult |
| if err = p.Client_().Call(ctx, "fetchResults", &_args78, &_result79); err != nil { |
| return |
| } |
| return _result79.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) FetchMetadata(ctx context.Context, req *TSFetchMetadataReq) (r *TSFetchMetadataResp, err error) { |
| var _args80 TSIServiceFetchMetadataArgs |
| _args80.Req = req |
| var _result81 TSIServiceFetchMetadataResult |
| if err = p.Client_().Call(ctx, "fetchMetadata", &_args80, &_result81); err != nil { |
| return |
| } |
| return _result81.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) CancelOperation(ctx context.Context, req *TSCancelOperationReq) (r *TSStatus, err error) { |
| var _args82 TSIServiceCancelOperationArgs |
| _args82.Req = req |
| var _result83 TSIServiceCancelOperationResult |
| if err = p.Client_().Call(ctx, "cancelOperation", &_args82, &_result83); err != nil { |
| return |
| } |
| return _result83.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) CloseOperation(ctx context.Context, req *TSCloseOperationReq) (r *TSStatus, err error) { |
| var _args84 TSIServiceCloseOperationArgs |
| _args84.Req = req |
| var _result85 TSIServiceCloseOperationResult |
| if err = p.Client_().Call(ctx, "closeOperation", &_args84, &_result85); err != nil { |
| return |
| } |
| return _result85.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - SessionId |
| func (p *TSIServiceClient) GetTimeZone(ctx context.Context, sessionId int64) (r *TSGetTimeZoneResp, err error) { |
| var _args86 TSIServiceGetTimeZoneArgs |
| _args86.SessionId = sessionId |
| var _result87 TSIServiceGetTimeZoneResult |
| if err = p.Client_().Call(ctx, "getTimeZone", &_args86, &_result87); err != nil { |
| return |
| } |
| return _result87.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) SetTimeZone(ctx context.Context, req *TSSetTimeZoneReq) (r *TSStatus, err error) { |
| var _args88 TSIServiceSetTimeZoneArgs |
| _args88.Req = req |
| var _result89 TSIServiceSetTimeZoneResult |
| if err = p.Client_().Call(ctx, "setTimeZone", &_args88, &_result89); err != nil { |
| return |
| } |
| return _result89.GetSuccess(), nil |
| } |
| |
| func (p *TSIServiceClient) GetProperties(ctx context.Context) (r *ServerProperties, err error) { |
| var _args90 TSIServiceGetPropertiesArgs |
| var _result91 TSIServiceGetPropertiesResult |
| if err = p.Client_().Call(ctx, "getProperties", &_args90, &_result91); err != nil { |
| return |
| } |
| return _result91.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - SessionId |
| // - StorageGroup |
| func (p *TSIServiceClient) SetStorageGroup(ctx context.Context, sessionId int64, storageGroup string) (r *TSStatus, err error) { |
| var _args92 TSIServiceSetStorageGroupArgs |
| _args92.SessionId = sessionId |
| _args92.StorageGroup = storageGroup |
| var _result93 TSIServiceSetStorageGroupResult |
| if err = p.Client_().Call(ctx, "setStorageGroup", &_args92, &_result93); err != nil { |
| return |
| } |
| return _result93.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) CreateTimeseries(ctx context.Context, req *TSCreateTimeseriesReq) (r *TSStatus, err error) { |
| var _args94 TSIServiceCreateTimeseriesArgs |
| _args94.Req = req |
| var _result95 TSIServiceCreateTimeseriesResult |
| if err = p.Client_().Call(ctx, "createTimeseries", &_args94, &_result95); err != nil { |
| return |
| } |
| return _result95.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) CreateMultiTimeseries(ctx context.Context, req *TSCreateMultiTimeseriesReq) (r *TSStatus, err error) { |
| var _args96 TSIServiceCreateMultiTimeseriesArgs |
| _args96.Req = req |
| var _result97 TSIServiceCreateMultiTimeseriesResult |
| if err = p.Client_().Call(ctx, "createMultiTimeseries", &_args96, &_result97); err != nil { |
| return |
| } |
| return _result97.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - SessionId |
| // - Path |
| func (p *TSIServiceClient) DeleteTimeseries(ctx context.Context, sessionId int64, path []string) (r *TSStatus, err error) { |
| var _args98 TSIServiceDeleteTimeseriesArgs |
| _args98.SessionId = sessionId |
| _args98.Path = path |
| var _result99 TSIServiceDeleteTimeseriesResult |
| if err = p.Client_().Call(ctx, "deleteTimeseries", &_args98, &_result99); err != nil { |
| return |
| } |
| return _result99.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - SessionId |
| // - StorageGroup |
| func (p *TSIServiceClient) DeleteStorageGroups(ctx context.Context, sessionId int64, storageGroup []string) (r *TSStatus, err error) { |
| var _args100 TSIServiceDeleteStorageGroupsArgs |
| _args100.SessionId = sessionId |
| _args100.StorageGroup = storageGroup |
| var _result101 TSIServiceDeleteStorageGroupsResult |
| if err = p.Client_().Call(ctx, "deleteStorageGroups", &_args100, &_result101); err != nil { |
| return |
| } |
| return _result101.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertRecord(ctx context.Context, req *TSInsertRecordReq) (r *TSStatus, err error) { |
| var _args102 TSIServiceInsertRecordArgs |
| _args102.Req = req |
| var _result103 TSIServiceInsertRecordResult |
| if err = p.Client_().Call(ctx, "insertRecord", &_args102, &_result103); err != nil { |
| return |
| } |
| return _result103.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertStringRecord(ctx context.Context, req *TSInsertStringRecordReq) (r *TSStatus, err error) { |
| var _args104 TSIServiceInsertStringRecordArgs |
| _args104.Req = req |
| var _result105 TSIServiceInsertStringRecordResult |
| if err = p.Client_().Call(ctx, "insertStringRecord", &_args104, &_result105); err != nil { |
| return |
| } |
| return _result105.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertTablet(ctx context.Context, req *TSInsertTabletReq) (r *TSStatus, err error) { |
| var _args106 TSIServiceInsertTabletArgs |
| _args106.Req = req |
| var _result107 TSIServiceInsertTabletResult |
| if err = p.Client_().Call(ctx, "insertTablet", &_args106, &_result107); err != nil { |
| return |
| } |
| return _result107.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertTablets(ctx context.Context, req *TSInsertTabletsReq) (r *TSStatus, err error) { |
| var _args108 TSIServiceInsertTabletsArgs |
| _args108.Req = req |
| var _result109 TSIServiceInsertTabletsResult |
| if err = p.Client_().Call(ctx, "insertTablets", &_args108, &_result109); err != nil { |
| return |
| } |
| return _result109.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertRecords(ctx context.Context, req *TSInsertRecordsReq) (r *TSStatus, err error) { |
| var _args110 TSIServiceInsertRecordsArgs |
| _args110.Req = req |
| var _result111 TSIServiceInsertRecordsResult |
| if err = p.Client_().Call(ctx, "insertRecords", &_args110, &_result111); err != nil { |
| return |
| } |
| return _result111.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertRecordsOfOneDevice(ctx context.Context, req *TSInsertRecordsOfOneDeviceReq) (r *TSStatus, err error) { |
| var _args112 TSIServiceInsertRecordsOfOneDeviceArgs |
| _args112.Req = req |
| var _result113 TSIServiceInsertRecordsOfOneDeviceResult |
| if err = p.Client_().Call(ctx, "insertRecordsOfOneDevice", &_args112, &_result113); err != nil { |
| return |
| } |
| return _result113.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) InsertStringRecords(ctx context.Context, req *TSInsertStringRecordsReq) (r *TSStatus, err error) { |
| var _args114 TSIServiceInsertStringRecordsArgs |
| _args114.Req = req |
| var _result115 TSIServiceInsertStringRecordsResult |
| if err = p.Client_().Call(ctx, "insertStringRecords", &_args114, &_result115); err != nil { |
| return |
| } |
| return _result115.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertTablet(ctx context.Context, req *TSInsertTabletReq) (r *TSStatus, err error) { |
| var _args116 TSIServiceTestInsertTabletArgs |
| _args116.Req = req |
| var _result117 TSIServiceTestInsertTabletResult |
| if err = p.Client_().Call(ctx, "testInsertTablet", &_args116, &_result117); err != nil { |
| return |
| } |
| return _result117.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertTablets(ctx context.Context, req *TSInsertTabletsReq) (r *TSStatus, err error) { |
| var _args118 TSIServiceTestInsertTabletsArgs |
| _args118.Req = req |
| var _result119 TSIServiceTestInsertTabletsResult |
| if err = p.Client_().Call(ctx, "testInsertTablets", &_args118, &_result119); err != nil { |
| return |
| } |
| return _result119.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertRecord(ctx context.Context, req *TSInsertRecordReq) (r *TSStatus, err error) { |
| var _args120 TSIServiceTestInsertRecordArgs |
| _args120.Req = req |
| var _result121 TSIServiceTestInsertRecordResult |
| if err = p.Client_().Call(ctx, "testInsertRecord", &_args120, &_result121); err != nil { |
| return |
| } |
| return _result121.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertStringRecord(ctx context.Context, req *TSInsertStringRecordReq) (r *TSStatus, err error) { |
| var _args122 TSIServiceTestInsertStringRecordArgs |
| _args122.Req = req |
| var _result123 TSIServiceTestInsertStringRecordResult |
| if err = p.Client_().Call(ctx, "testInsertStringRecord", &_args122, &_result123); err != nil { |
| return |
| } |
| return _result123.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertRecords(ctx context.Context, req *TSInsertRecordsReq) (r *TSStatus, err error) { |
| var _args124 TSIServiceTestInsertRecordsArgs |
| _args124.Req = req |
| var _result125 TSIServiceTestInsertRecordsResult |
| if err = p.Client_().Call(ctx, "testInsertRecords", &_args124, &_result125); err != nil { |
| return |
| } |
| return _result125.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertRecordsOfOneDevice(ctx context.Context, req *TSInsertRecordsOfOneDeviceReq) (r *TSStatus, err error) { |
| var _args126 TSIServiceTestInsertRecordsOfOneDeviceArgs |
| _args126.Req = req |
| var _result127 TSIServiceTestInsertRecordsOfOneDeviceResult |
| if err = p.Client_().Call(ctx, "testInsertRecordsOfOneDevice", &_args126, &_result127); err != nil { |
| return |
| } |
| return _result127.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) TestInsertStringRecords(ctx context.Context, req *TSInsertStringRecordsReq) (r *TSStatus, err error) { |
| var _args128 TSIServiceTestInsertStringRecordsArgs |
| _args128.Req = req |
| var _result129 TSIServiceTestInsertStringRecordsResult |
| if err = p.Client_().Call(ctx, "testInsertStringRecords", &_args128, &_result129); err != nil { |
| return |
| } |
| return _result129.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) DeleteData(ctx context.Context, req *TSDeleteDataReq) (r *TSStatus, err error) { |
| var _args130 TSIServiceDeleteDataArgs |
| _args130.Req = req |
| var _result131 TSIServiceDeleteDataResult |
| if err = p.Client_().Call(ctx, "deleteData", &_args130, &_result131); err != nil { |
| return |
| } |
| return _result131.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - Req |
| func (p *TSIServiceClient) ExecuteRawDataQuery(ctx context.Context, req *TSRawDataQueryReq) (r *TSExecuteStatementResp, err error) { |
| var _args132 TSIServiceExecuteRawDataQueryArgs |
| _args132.Req = req |
| var _result133 TSIServiceExecuteRawDataQueryResult |
| if err = p.Client_().Call(ctx, "executeRawDataQuery", &_args132, &_result133); err != nil { |
| return |
| } |
| return _result133.GetSuccess(), nil |
| } |
| |
| // Parameters: |
| // - SessionId |
| func (p *TSIServiceClient) RequestStatementId(ctx context.Context, sessionId int64) (r int64, err error) { |
| var _args134 TSIServiceRequestStatementIdArgs |
| _args134.SessionId = sessionId |
| var _result135 TSIServiceRequestStatementIdResult |
| if err = p.Client_().Call(ctx, "requestStatementId", &_args134, &_result135); err != nil { |
| return |
| } |
| return _result135.GetSuccess(), nil |
| } |
| |
| type TSIServiceProcessor struct { |
| processorMap map[string]thrift.TProcessorFunction |
| handler TSIService |
| } |
| |
| func (p *TSIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { |
| p.processorMap[key] = processor |
| } |
| |
| func (p *TSIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { |
| processor, ok = p.processorMap[key] |
| return processor, ok |
| } |
| |
| func (p *TSIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { |
| return p.processorMap |
| } |
| |
| func NewTSIServiceProcessor(handler TSIService) *TSIServiceProcessor { |
| |
| self136 := &TSIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} |
| self136.processorMap["openSession"] = &tSIServiceProcessorOpenSession{handler: handler} |
| self136.processorMap["closeSession"] = &tSIServiceProcessorCloseSession{handler: handler} |
| self136.processorMap["executeStatement"] = &tSIServiceProcessorExecuteStatement{handler: handler} |
| self136.processorMap["executeBatchStatement"] = &tSIServiceProcessorExecuteBatchStatement{handler: handler} |
| self136.processorMap["executeQueryStatement"] = &tSIServiceProcessorExecuteQueryStatement{handler: handler} |
| self136.processorMap["executeUpdateStatement"] = &tSIServiceProcessorExecuteUpdateStatement{handler: handler} |
| self136.processorMap["fetchResults"] = &tSIServiceProcessorFetchResults{handler: handler} |
| self136.processorMap["fetchMetadata"] = &tSIServiceProcessorFetchMetadata{handler: handler} |
| self136.processorMap["cancelOperation"] = &tSIServiceProcessorCancelOperation{handler: handler} |
| self136.processorMap["closeOperation"] = &tSIServiceProcessorCloseOperation{handler: handler} |
| self136.processorMap["getTimeZone"] = &tSIServiceProcessorGetTimeZone{handler: handler} |
| self136.processorMap["setTimeZone"] = &tSIServiceProcessorSetTimeZone{handler: handler} |
| self136.processorMap["getProperties"] = &tSIServiceProcessorGetProperties{handler: handler} |
| self136.processorMap["setStorageGroup"] = &tSIServiceProcessorSetStorageGroup{handler: handler} |
| self136.processorMap["createTimeseries"] = &tSIServiceProcessorCreateTimeseries{handler: handler} |
| self136.processorMap["createMultiTimeseries"] = &tSIServiceProcessorCreateMultiTimeseries{handler: handler} |
| self136.processorMap["deleteTimeseries"] = &tSIServiceProcessorDeleteTimeseries{handler: handler} |
| self136.processorMap["deleteStorageGroups"] = &tSIServiceProcessorDeleteStorageGroups{handler: handler} |
| self136.processorMap["insertRecord"] = &tSIServiceProcessorInsertRecord{handler: handler} |
| self136.processorMap["insertStringRecord"] = &tSIServiceProcessorInsertStringRecord{handler: handler} |
| self136.processorMap["insertTablet"] = &tSIServiceProcessorInsertTablet{handler: handler} |
| self136.processorMap["insertTablets"] = &tSIServiceProcessorInsertTablets{handler: handler} |
| self136.processorMap["insertRecords"] = &tSIServiceProcessorInsertRecords{handler: handler} |
| self136.processorMap["insertRecordsOfOneDevice"] = &tSIServiceProcessorInsertRecordsOfOneDevice{handler: handler} |
| self136.processorMap["insertStringRecords"] = &tSIServiceProcessorInsertStringRecords{handler: handler} |
| self136.processorMap["testInsertTablet"] = &tSIServiceProcessorTestInsertTablet{handler: handler} |
| self136.processorMap["testInsertTablets"] = &tSIServiceProcessorTestInsertTablets{handler: handler} |
| self136.processorMap["testInsertRecord"] = &tSIServiceProcessorTestInsertRecord{handler: handler} |
| self136.processorMap["testInsertStringRecord"] = &tSIServiceProcessorTestInsertStringRecord{handler: handler} |
| self136.processorMap["testInsertRecords"] = &tSIServiceProcessorTestInsertRecords{handler: handler} |
| self136.processorMap["testInsertRecordsOfOneDevice"] = &tSIServiceProcessorTestInsertRecordsOfOneDevice{handler: handler} |
| self136.processorMap["testInsertStringRecords"] = &tSIServiceProcessorTestInsertStringRecords{handler: handler} |
| self136.processorMap["deleteData"] = &tSIServiceProcessorDeleteData{handler: handler} |
| self136.processorMap["executeRawDataQuery"] = &tSIServiceProcessorExecuteRawDataQuery{handler: handler} |
| self136.processorMap["requestStatementId"] = &tSIServiceProcessorRequestStatementId{handler: handler} |
| return self136 |
| } |
| |
| func (p *TSIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| name, _, seqId, err := iprot.ReadMessageBegin() |
| if err != nil { |
| return false, err |
| } |
| if processor, ok := p.GetProcessorFunction(name); ok { |
| return processor.Process(ctx, seqId, iprot, oprot) |
| } |
| iprot.Skip(thrift.STRUCT) |
| iprot.ReadMessageEnd() |
| x137 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) |
| oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) |
| x137.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, x137 |
| |
| } |
| |
| type tSIServiceProcessorOpenSession struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceOpenSessionArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("openSession", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceOpenSessionResult{} |
| var retval *TSOpenSessionResp |
| var err2 error |
| if retval, err2 = p.handler.OpenSession(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing openSession: "+err2.Error()) |
| oprot.WriteMessageBegin("openSession", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("openSession", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorCloseSession struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceCloseSessionArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("closeSession", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceCloseSessionResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.CloseSession(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing closeSession: "+err2.Error()) |
| oprot.WriteMessageBegin("closeSession", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("closeSession", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorExecuteStatement struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceExecuteStatementArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("executeStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceExecuteStatementResult{} |
| var retval *TSExecuteStatementResp |
| var err2 error |
| if retval, err2 = p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeStatement: "+err2.Error()) |
| oprot.WriteMessageBegin("executeStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("executeStatement", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorExecuteBatchStatement struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorExecuteBatchStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceExecuteBatchStatementArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("executeBatchStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceExecuteBatchStatementResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.ExecuteBatchStatement(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeBatchStatement: "+err2.Error()) |
| oprot.WriteMessageBegin("executeBatchStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("executeBatchStatement", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorExecuteQueryStatement struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorExecuteQueryStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceExecuteQueryStatementArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("executeQueryStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceExecuteQueryStatementResult{} |
| var retval *TSExecuteStatementResp |
| var err2 error |
| if retval, err2 = p.handler.ExecuteQueryStatement(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeQueryStatement: "+err2.Error()) |
| oprot.WriteMessageBegin("executeQueryStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("executeQueryStatement", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorExecuteUpdateStatement struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorExecuteUpdateStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceExecuteUpdateStatementArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("executeUpdateStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceExecuteUpdateStatementResult{} |
| var retval *TSExecuteStatementResp |
| var err2 error |
| if retval, err2 = p.handler.ExecuteUpdateStatement(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeUpdateStatement: "+err2.Error()) |
| oprot.WriteMessageBegin("executeUpdateStatement", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("executeUpdateStatement", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorFetchResults struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceFetchResultsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("fetchResults", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceFetchResultsResult{} |
| var retval *TSFetchResultsResp |
| var err2 error |
| if retval, err2 = p.handler.FetchResults(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing fetchResults: "+err2.Error()) |
| oprot.WriteMessageBegin("fetchResults", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("fetchResults", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorFetchMetadata struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorFetchMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceFetchMetadataArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("fetchMetadata", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceFetchMetadataResult{} |
| var retval *TSFetchMetadataResp |
| var err2 error |
| if retval, err2 = p.handler.FetchMetadata(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing fetchMetadata: "+err2.Error()) |
| oprot.WriteMessageBegin("fetchMetadata", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("fetchMetadata", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorCancelOperation struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceCancelOperationArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("cancelOperation", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceCancelOperationResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.CancelOperation(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing cancelOperation: "+err2.Error()) |
| oprot.WriteMessageBegin("cancelOperation", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("cancelOperation", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorCloseOperation struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceCloseOperationArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("closeOperation", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceCloseOperationResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.CloseOperation(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing closeOperation: "+err2.Error()) |
| oprot.WriteMessageBegin("closeOperation", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("closeOperation", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorGetTimeZone struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorGetTimeZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceGetTimeZoneArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("getTimeZone", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceGetTimeZoneResult{} |
| var retval *TSGetTimeZoneResp |
| var err2 error |
| if retval, err2 = p.handler.GetTimeZone(ctx, args.SessionId); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTimeZone: "+err2.Error()) |
| oprot.WriteMessageBegin("getTimeZone", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("getTimeZone", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorSetTimeZone struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorSetTimeZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceSetTimeZoneArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("setTimeZone", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceSetTimeZoneResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.SetTimeZone(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setTimeZone: "+err2.Error()) |
| oprot.WriteMessageBegin("setTimeZone", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("setTimeZone", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorGetProperties struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorGetProperties) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceGetPropertiesArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("getProperties", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceGetPropertiesResult{} |
| var retval *ServerProperties |
| var err2 error |
| if retval, err2 = p.handler.GetProperties(ctx); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getProperties: "+err2.Error()) |
| oprot.WriteMessageBegin("getProperties", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("getProperties", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorSetStorageGroup struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorSetStorageGroup) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceSetStorageGroupArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("setStorageGroup", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceSetStorageGroupResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.SetStorageGroup(ctx, args.SessionId, args.StorageGroup); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setStorageGroup: "+err2.Error()) |
| oprot.WriteMessageBegin("setStorageGroup", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("setStorageGroup", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorCreateTimeseries struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorCreateTimeseries) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceCreateTimeseriesArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("createTimeseries", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceCreateTimeseriesResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.CreateTimeseries(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTimeseries: "+err2.Error()) |
| oprot.WriteMessageBegin("createTimeseries", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("createTimeseries", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorCreateMultiTimeseries struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorCreateMultiTimeseries) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceCreateMultiTimeseriesArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("createMultiTimeseries", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceCreateMultiTimeseriesResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.CreateMultiTimeseries(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createMultiTimeseries: "+err2.Error()) |
| oprot.WriteMessageBegin("createMultiTimeseries", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("createMultiTimeseries", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorDeleteTimeseries struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorDeleteTimeseries) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceDeleteTimeseriesArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("deleteTimeseries", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceDeleteTimeseriesResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.DeleteTimeseries(ctx, args.SessionId, args.Path); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTimeseries: "+err2.Error()) |
| oprot.WriteMessageBegin("deleteTimeseries", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("deleteTimeseries", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorDeleteStorageGroups struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorDeleteStorageGroups) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceDeleteStorageGroupsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("deleteStorageGroups", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceDeleteStorageGroupsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.DeleteStorageGroups(ctx, args.SessionId, args.StorageGroup); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteStorageGroups: "+err2.Error()) |
| oprot.WriteMessageBegin("deleteStorageGroups", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("deleteStorageGroups", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertRecord struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertRecordArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertRecordResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertRecord(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertRecord: "+err2.Error()) |
| oprot.WriteMessageBegin("insertRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertRecord", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertStringRecord struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertStringRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertStringRecordArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertStringRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertStringRecordResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertStringRecord(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertStringRecord: "+err2.Error()) |
| oprot.WriteMessageBegin("insertStringRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertStringRecord", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertTablet struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertTablet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertTabletArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertTablet", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertTabletResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertTablet(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertTablet: "+err2.Error()) |
| oprot.WriteMessageBegin("insertTablet", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertTablet", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertTablets struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertTablets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertTabletsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertTablets", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertTabletsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertTablets(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertTablets: "+err2.Error()) |
| oprot.WriteMessageBegin("insertTablets", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertTablets", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertRecords struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertRecordsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertRecordsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertRecords(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertRecords: "+err2.Error()) |
| oprot.WriteMessageBegin("insertRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertRecords", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertRecordsOfOneDevice struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertRecordsOfOneDevice) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertRecordsOfOneDeviceArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertRecordsOfOneDevice", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertRecordsOfOneDeviceResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertRecordsOfOneDevice(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertRecordsOfOneDevice: "+err2.Error()) |
| oprot.WriteMessageBegin("insertRecordsOfOneDevice", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertRecordsOfOneDevice", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorInsertStringRecords struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorInsertStringRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceInsertStringRecordsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("insertStringRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceInsertStringRecordsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.InsertStringRecords(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertStringRecords: "+err2.Error()) |
| oprot.WriteMessageBegin("insertStringRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("insertStringRecords", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertTablet struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertTablet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertTabletArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertTablet", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertTabletResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertTablet(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertTablet: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertTablet", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertTablet", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertTablets struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertTablets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertTabletsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertTablets", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertTabletsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertTablets(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertTablets: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertTablets", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertTablets", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertRecord struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertRecordArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertRecordResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertRecord(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertRecord: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertRecord", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertStringRecord struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertStringRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertStringRecordArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertStringRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertStringRecordResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertStringRecord(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertStringRecord: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertStringRecord", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertStringRecord", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertRecords struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertRecordsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertRecordsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertRecords(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertRecords: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertRecords", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertRecordsOfOneDevice struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertRecordsOfOneDevice) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertRecordsOfOneDeviceArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertRecordsOfOneDevice", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertRecordsOfOneDeviceResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertRecordsOfOneDevice(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertRecordsOfOneDevice: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertRecordsOfOneDevice", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertRecordsOfOneDevice", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorTestInsertStringRecords struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorTestInsertStringRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceTestInsertStringRecordsArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("testInsertStringRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceTestInsertStringRecordsResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.TestInsertStringRecords(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing testInsertStringRecords: "+err2.Error()) |
| oprot.WriteMessageBegin("testInsertStringRecords", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("testInsertStringRecords", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorDeleteData struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorDeleteData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceDeleteDataArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("deleteData", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceDeleteDataResult{} |
| var retval *TSStatus |
| var err2 error |
| if retval, err2 = p.handler.DeleteData(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteData: "+err2.Error()) |
| oprot.WriteMessageBegin("deleteData", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("deleteData", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorExecuteRawDataQuery struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorExecuteRawDataQuery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceExecuteRawDataQueryArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("executeRawDataQuery", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceExecuteRawDataQueryResult{} |
| var retval *TSExecuteStatementResp |
| var err2 error |
| if retval, err2 = p.handler.ExecuteRawDataQuery(ctx, args.Req); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeRawDataQuery: "+err2.Error()) |
| oprot.WriteMessageBegin("executeRawDataQuery", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = retval |
| } |
| if err2 = oprot.WriteMessageBegin("executeRawDataQuery", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| type tSIServiceProcessorRequestStatementId struct { |
| handler TSIService |
| } |
| |
| func (p *tSIServiceProcessorRequestStatementId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| args := TSIServiceRequestStatementIdArgs{} |
| if err = args.Read(iprot); err != nil { |
| iprot.ReadMessageEnd() |
| x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) |
| oprot.WriteMessageBegin("requestStatementId", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return false, err |
| } |
| |
| iprot.ReadMessageEnd() |
| result := TSIServiceRequestStatementIdResult{} |
| var retval int64 |
| var err2 error |
| if retval, err2 = p.handler.RequestStatementId(ctx, args.SessionId); err2 != nil { |
| x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing requestStatementId: "+err2.Error()) |
| oprot.WriteMessageBegin("requestStatementId", thrift.EXCEPTION, seqId) |
| x.Write(oprot) |
| oprot.WriteMessageEnd() |
| oprot.Flush(ctx) |
| return true, err2 |
| } else { |
| result.Success = &retval |
| } |
| if err2 = oprot.WriteMessageBegin("requestStatementId", thrift.REPLY, seqId); err2 != nil { |
| err = err2 |
| } |
| if err2 = result.Write(oprot); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err2 = oprot.Flush(ctx); err == nil && err2 != nil { |
| err = err2 |
| } |
| if err != nil { |
| return |
| } |
| return true, err |
| } |
| |
| // HELPER FUNCTIONS AND STRUCTURES |
| |
| // Attributes: |
| // - Req |
| type TSIServiceOpenSessionArgs struct { |
| Req *TSOpenSessionReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceOpenSessionArgs() *TSIServiceOpenSessionArgs { |
| return &TSIServiceOpenSessionArgs{} |
| } |
| |
| var TSIServiceOpenSessionArgs_Req_DEFAULT *TSOpenSessionReq |
| |
| func (p *TSIServiceOpenSessionArgs) GetReq() *TSOpenSessionReq { |
| if !p.IsSetReq() { |
| return TSIServiceOpenSessionArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceOpenSessionArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceOpenSessionArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceOpenSessionArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSOpenSessionReq{ |
| ClientProtocol: 2, |
| } |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceOpenSessionArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("openSession_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceOpenSessionArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceOpenSessionArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceOpenSessionArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceOpenSessionResult struct { |
| Success *TSOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceOpenSessionResult() *TSIServiceOpenSessionResult { |
| return &TSIServiceOpenSessionResult{} |
| } |
| |
| var TSIServiceOpenSessionResult_Success_DEFAULT *TSOpenSessionResp |
| |
| func (p *TSIServiceOpenSessionResult) GetSuccess() *TSOpenSessionResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceOpenSessionResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceOpenSessionResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceOpenSessionResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceOpenSessionResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSOpenSessionResp{ |
| ServerProtocolVersion: 0, |
| } |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceOpenSessionResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("openSession_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceOpenSessionResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceOpenSessionResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceOpenSessionResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceCloseSessionArgs struct { |
| Req *TSCloseSessionReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceCloseSessionArgs() *TSIServiceCloseSessionArgs { |
| return &TSIServiceCloseSessionArgs{} |
| } |
| |
| var TSIServiceCloseSessionArgs_Req_DEFAULT *TSCloseSessionReq |
| |
| func (p *TSIServiceCloseSessionArgs) GetReq() *TSCloseSessionReq { |
| if !p.IsSetReq() { |
| return TSIServiceCloseSessionArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceCloseSessionArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceCloseSessionArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseSessionArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSCloseSessionReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseSessionArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("closeSession_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseSessionArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCloseSessionArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCloseSessionArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceCloseSessionResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceCloseSessionResult() *TSIServiceCloseSessionResult { |
| return &TSIServiceCloseSessionResult{} |
| } |
| |
| var TSIServiceCloseSessionResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceCloseSessionResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceCloseSessionResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceCloseSessionResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceCloseSessionResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseSessionResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseSessionResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("closeSession_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseSessionResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCloseSessionResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCloseSessionResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceExecuteStatementArgs struct { |
| Req *TSExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceExecuteStatementArgs() *TSIServiceExecuteStatementArgs { |
| return &TSIServiceExecuteStatementArgs{} |
| } |
| |
| var TSIServiceExecuteStatementArgs_Req_DEFAULT *TSExecuteStatementReq |
| |
| func (p *TSIServiceExecuteStatementArgs) GetReq() *TSExecuteStatementReq { |
| if !p.IsSetReq() { |
| return TSIServiceExecuteStatementArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceExecuteStatementArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceExecuteStatementArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteStatementArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSExecuteStatementReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteStatementArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeStatement_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteStatementArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteStatementArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteStatementArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceExecuteStatementResult struct { |
| Success *TSExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceExecuteStatementResult() *TSIServiceExecuteStatementResult { |
| return &TSIServiceExecuteStatementResult{} |
| } |
| |
| var TSIServiceExecuteStatementResult_Success_DEFAULT *TSExecuteStatementResp |
| |
| func (p *TSIServiceExecuteStatementResult) GetSuccess() *TSExecuteStatementResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceExecuteStatementResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceExecuteStatementResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceExecuteStatementResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteStatementResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSExecuteStatementResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteStatementResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeStatement_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteStatementResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteStatementResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteStatementResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceExecuteBatchStatementArgs struct { |
| Req *TSExecuteBatchStatementReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceExecuteBatchStatementArgs() *TSIServiceExecuteBatchStatementArgs { |
| return &TSIServiceExecuteBatchStatementArgs{} |
| } |
| |
| var TSIServiceExecuteBatchStatementArgs_Req_DEFAULT *TSExecuteBatchStatementReq |
| |
| func (p *TSIServiceExecuteBatchStatementArgs) GetReq() *TSExecuteBatchStatementReq { |
| if !p.IsSetReq() { |
| return TSIServiceExecuteBatchStatementArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceExecuteBatchStatementArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSExecuteBatchStatementReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeBatchStatement_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteBatchStatementArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceExecuteBatchStatementResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceExecuteBatchStatementResult() *TSIServiceExecuteBatchStatementResult { |
| return &TSIServiceExecuteBatchStatementResult{} |
| } |
| |
| var TSIServiceExecuteBatchStatementResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceExecuteBatchStatementResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceExecuteBatchStatementResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceExecuteBatchStatementResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeBatchStatement_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteBatchStatementResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteBatchStatementResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceExecuteQueryStatementArgs struct { |
| Req *TSExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceExecuteQueryStatementArgs() *TSIServiceExecuteQueryStatementArgs { |
| return &TSIServiceExecuteQueryStatementArgs{} |
| } |
| |
| var TSIServiceExecuteQueryStatementArgs_Req_DEFAULT *TSExecuteStatementReq |
| |
| func (p *TSIServiceExecuteQueryStatementArgs) GetReq() *TSExecuteStatementReq { |
| if !p.IsSetReq() { |
| return TSIServiceExecuteQueryStatementArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceExecuteQueryStatementArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSExecuteStatementReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeQueryStatement_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteQueryStatementArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceExecuteQueryStatementResult struct { |
| Success *TSExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceExecuteQueryStatementResult() *TSIServiceExecuteQueryStatementResult { |
| return &TSIServiceExecuteQueryStatementResult{} |
| } |
| |
| var TSIServiceExecuteQueryStatementResult_Success_DEFAULT *TSExecuteStatementResp |
| |
| func (p *TSIServiceExecuteQueryStatementResult) GetSuccess() *TSExecuteStatementResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceExecuteQueryStatementResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceExecuteQueryStatementResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSExecuteStatementResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeQueryStatement_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteQueryStatementResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteQueryStatementResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceExecuteUpdateStatementArgs struct { |
| Req *TSExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceExecuteUpdateStatementArgs() *TSIServiceExecuteUpdateStatementArgs { |
| return &TSIServiceExecuteUpdateStatementArgs{} |
| } |
| |
| var TSIServiceExecuteUpdateStatementArgs_Req_DEFAULT *TSExecuteStatementReq |
| |
| func (p *TSIServiceExecuteUpdateStatementArgs) GetReq() *TSExecuteStatementReq { |
| if !p.IsSetReq() { |
| return TSIServiceExecuteUpdateStatementArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceExecuteUpdateStatementArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSExecuteStatementReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeUpdateStatement_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteUpdateStatementArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceExecuteUpdateStatementResult struct { |
| Success *TSExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceExecuteUpdateStatementResult() *TSIServiceExecuteUpdateStatementResult { |
| return &TSIServiceExecuteUpdateStatementResult{} |
| } |
| |
| var TSIServiceExecuteUpdateStatementResult_Success_DEFAULT *TSExecuteStatementResp |
| |
| func (p *TSIServiceExecuteUpdateStatementResult) GetSuccess() *TSExecuteStatementResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceExecuteUpdateStatementResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceExecuteUpdateStatementResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSExecuteStatementResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeUpdateStatement_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteUpdateStatementResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteUpdateStatementResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceFetchResultsArgs struct { |
| Req *TSFetchResultsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceFetchResultsArgs() *TSIServiceFetchResultsArgs { |
| return &TSIServiceFetchResultsArgs{} |
| } |
| |
| var TSIServiceFetchResultsArgs_Req_DEFAULT *TSFetchResultsReq |
| |
| func (p *TSIServiceFetchResultsArgs) GetReq() *TSFetchResultsReq { |
| if !p.IsSetReq() { |
| return TSIServiceFetchResultsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceFetchResultsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceFetchResultsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchResultsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSFetchResultsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchResultsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("fetchResults_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchResultsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceFetchResultsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceFetchResultsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceFetchResultsResult struct { |
| Success *TSFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceFetchResultsResult() *TSIServiceFetchResultsResult { |
| return &TSIServiceFetchResultsResult{} |
| } |
| |
| var TSIServiceFetchResultsResult_Success_DEFAULT *TSFetchResultsResp |
| |
| func (p *TSIServiceFetchResultsResult) GetSuccess() *TSFetchResultsResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceFetchResultsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceFetchResultsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceFetchResultsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchResultsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSFetchResultsResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchResultsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("fetchResults_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchResultsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceFetchResultsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceFetchResultsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceFetchMetadataArgs struct { |
| Req *TSFetchMetadataReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceFetchMetadataArgs() *TSIServiceFetchMetadataArgs { |
| return &TSIServiceFetchMetadataArgs{} |
| } |
| |
| var TSIServiceFetchMetadataArgs_Req_DEFAULT *TSFetchMetadataReq |
| |
| func (p *TSIServiceFetchMetadataArgs) GetReq() *TSFetchMetadataReq { |
| if !p.IsSetReq() { |
| return TSIServiceFetchMetadataArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceFetchMetadataArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceFetchMetadataArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchMetadataArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSFetchMetadataReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchMetadataArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("fetchMetadata_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchMetadataArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceFetchMetadataArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceFetchMetadataArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceFetchMetadataResult struct { |
| Success *TSFetchMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceFetchMetadataResult() *TSIServiceFetchMetadataResult { |
| return &TSIServiceFetchMetadataResult{} |
| } |
| |
| var TSIServiceFetchMetadataResult_Success_DEFAULT *TSFetchMetadataResp |
| |
| func (p *TSIServiceFetchMetadataResult) GetSuccess() *TSFetchMetadataResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceFetchMetadataResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceFetchMetadataResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceFetchMetadataResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchMetadataResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSFetchMetadataResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchMetadataResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("fetchMetadata_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceFetchMetadataResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceFetchMetadataResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceFetchMetadataResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceCancelOperationArgs struct { |
| Req *TSCancelOperationReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceCancelOperationArgs() *TSIServiceCancelOperationArgs { |
| return &TSIServiceCancelOperationArgs{} |
| } |
| |
| var TSIServiceCancelOperationArgs_Req_DEFAULT *TSCancelOperationReq |
| |
| func (p *TSIServiceCancelOperationArgs) GetReq() *TSCancelOperationReq { |
| if !p.IsSetReq() { |
| return TSIServiceCancelOperationArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceCancelOperationArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceCancelOperationArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCancelOperationArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSCancelOperationReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCancelOperationArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("cancelOperation_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCancelOperationArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCancelOperationArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCancelOperationArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceCancelOperationResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceCancelOperationResult() *TSIServiceCancelOperationResult { |
| return &TSIServiceCancelOperationResult{} |
| } |
| |
| var TSIServiceCancelOperationResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceCancelOperationResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceCancelOperationResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceCancelOperationResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceCancelOperationResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCancelOperationResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCancelOperationResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("cancelOperation_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCancelOperationResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCancelOperationResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCancelOperationResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceCloseOperationArgs struct { |
| Req *TSCloseOperationReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceCloseOperationArgs() *TSIServiceCloseOperationArgs { |
| return &TSIServiceCloseOperationArgs{} |
| } |
| |
| var TSIServiceCloseOperationArgs_Req_DEFAULT *TSCloseOperationReq |
| |
| func (p *TSIServiceCloseOperationArgs) GetReq() *TSCloseOperationReq { |
| if !p.IsSetReq() { |
| return TSIServiceCloseOperationArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceCloseOperationArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceCloseOperationArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseOperationArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSCloseOperationReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseOperationArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("closeOperation_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseOperationArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCloseOperationArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCloseOperationArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceCloseOperationResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceCloseOperationResult() *TSIServiceCloseOperationResult { |
| return &TSIServiceCloseOperationResult{} |
| } |
| |
| var TSIServiceCloseOperationResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceCloseOperationResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceCloseOperationResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceCloseOperationResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceCloseOperationResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseOperationResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseOperationResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("closeOperation_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCloseOperationResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCloseOperationResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCloseOperationResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| type TSIServiceGetTimeZoneArgs struct { |
| SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` |
| } |
| |
| func NewTSIServiceGetTimeZoneArgs() *TSIServiceGetTimeZoneArgs { |
| return &TSIServiceGetTimeZoneArgs{} |
| } |
| |
| func (p *TSIServiceGetTimeZoneArgs) GetSessionId() int64 { |
| return p.SessionId |
| } |
| func (p *TSIServiceGetTimeZoneArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneArgs) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("getTimeZone_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceGetTimeZoneArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceGetTimeZoneArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceGetTimeZoneResult struct { |
| Success *TSGetTimeZoneResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceGetTimeZoneResult() *TSIServiceGetTimeZoneResult { |
| return &TSIServiceGetTimeZoneResult{} |
| } |
| |
| var TSIServiceGetTimeZoneResult_Success_DEFAULT *TSGetTimeZoneResp |
| |
| func (p *TSIServiceGetTimeZoneResult) GetSuccess() *TSGetTimeZoneResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceGetTimeZoneResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceGetTimeZoneResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSGetTimeZoneResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("getTimeZone_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetTimeZoneResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceGetTimeZoneResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceGetTimeZoneResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceSetTimeZoneArgs struct { |
| Req *TSSetTimeZoneReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceSetTimeZoneArgs() *TSIServiceSetTimeZoneArgs { |
| return &TSIServiceSetTimeZoneArgs{} |
| } |
| |
| var TSIServiceSetTimeZoneArgs_Req_DEFAULT *TSSetTimeZoneReq |
| |
| func (p *TSIServiceSetTimeZoneArgs) GetReq() *TSSetTimeZoneReq { |
| if !p.IsSetReq() { |
| return TSIServiceSetTimeZoneArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceSetTimeZoneArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSSetTimeZoneReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("setTimeZone_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceSetTimeZoneArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceSetTimeZoneArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceSetTimeZoneResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceSetTimeZoneResult() *TSIServiceSetTimeZoneResult { |
| return &TSIServiceSetTimeZoneResult{} |
| } |
| |
| var TSIServiceSetTimeZoneResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceSetTimeZoneResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceSetTimeZoneResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceSetTimeZoneResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("setTimeZone_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetTimeZoneResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceSetTimeZoneResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceSetTimeZoneResult(%+v)", *p) |
| } |
| |
| type TSIServiceGetPropertiesArgs struct { |
| } |
| |
| func NewTSIServiceGetPropertiesArgs() *TSIServiceGetPropertiesArgs { |
| return &TSIServiceGetPropertiesArgs{} |
| } |
| |
| func (p *TSIServiceGetPropertiesArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetPropertiesArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("getProperties_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetPropertiesArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceGetPropertiesArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceGetPropertiesResult struct { |
| Success *ServerProperties `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceGetPropertiesResult() *TSIServiceGetPropertiesResult { |
| return &TSIServiceGetPropertiesResult{} |
| } |
| |
| var TSIServiceGetPropertiesResult_Success_DEFAULT *ServerProperties |
| |
| func (p *TSIServiceGetPropertiesResult) GetSuccess() *ServerProperties { |
| if !p.IsSetSuccess() { |
| return TSIServiceGetPropertiesResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceGetPropertiesResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceGetPropertiesResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetPropertiesResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &ServerProperties{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetPropertiesResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("getProperties_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceGetPropertiesResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceGetPropertiesResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceGetPropertiesResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - StorageGroup |
| type TSIServiceSetStorageGroupArgs struct { |
| SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` |
| StorageGroup string `thrift:"storageGroup,2" db:"storageGroup" json:"storageGroup"` |
| } |
| |
| func NewTSIServiceSetStorageGroupArgs() *TSIServiceSetStorageGroupArgs { |
| return &TSIServiceSetStorageGroupArgs{} |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) GetStorageGroup() string { |
| return p.StorageGroup |
| } |
| func (p *TSIServiceSetStorageGroupArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.STRING { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) ReadField2(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 2: ", err) |
| } else { |
| p.StorageGroup = v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("setStorageGroup_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("storageGroup", thrift.STRING, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:storageGroup: ", p), err) |
| } |
| if err := oprot.WriteString(string(p.StorageGroup)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.storageGroup (2) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:storageGroup: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceSetStorageGroupArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceSetStorageGroupArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceSetStorageGroupResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceSetStorageGroupResult() *TSIServiceSetStorageGroupResult { |
| return &TSIServiceSetStorageGroupResult{} |
| } |
| |
| var TSIServiceSetStorageGroupResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceSetStorageGroupResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceSetStorageGroupResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceSetStorageGroupResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("setStorageGroup_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceSetStorageGroupResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceSetStorageGroupResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceSetStorageGroupResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceCreateTimeseriesArgs struct { |
| Req *TSCreateTimeseriesReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceCreateTimeseriesArgs() *TSIServiceCreateTimeseriesArgs { |
| return &TSIServiceCreateTimeseriesArgs{} |
| } |
| |
| var TSIServiceCreateTimeseriesArgs_Req_DEFAULT *TSCreateTimeseriesReq |
| |
| func (p *TSIServiceCreateTimeseriesArgs) GetReq() *TSCreateTimeseriesReq { |
| if !p.IsSetReq() { |
| return TSIServiceCreateTimeseriesArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceCreateTimeseriesArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSCreateTimeseriesReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("createTimeseries_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCreateTimeseriesArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCreateTimeseriesArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceCreateTimeseriesResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceCreateTimeseriesResult() *TSIServiceCreateTimeseriesResult { |
| return &TSIServiceCreateTimeseriesResult{} |
| } |
| |
| var TSIServiceCreateTimeseriesResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceCreateTimeseriesResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceCreateTimeseriesResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceCreateTimeseriesResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("createTimeseries_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateTimeseriesResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCreateTimeseriesResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCreateTimeseriesResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceCreateMultiTimeseriesArgs struct { |
| Req *TSCreateMultiTimeseriesReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceCreateMultiTimeseriesArgs() *TSIServiceCreateMultiTimeseriesArgs { |
| return &TSIServiceCreateMultiTimeseriesArgs{} |
| } |
| |
| var TSIServiceCreateMultiTimeseriesArgs_Req_DEFAULT *TSCreateMultiTimeseriesReq |
| |
| func (p *TSIServiceCreateMultiTimeseriesArgs) GetReq() *TSCreateMultiTimeseriesReq { |
| if !p.IsSetReq() { |
| return TSIServiceCreateMultiTimeseriesArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceCreateMultiTimeseriesArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSCreateMultiTimeseriesReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("createMultiTimeseries_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCreateMultiTimeseriesArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceCreateMultiTimeseriesResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceCreateMultiTimeseriesResult() *TSIServiceCreateMultiTimeseriesResult { |
| return &TSIServiceCreateMultiTimeseriesResult{} |
| } |
| |
| var TSIServiceCreateMultiTimeseriesResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceCreateMultiTimeseriesResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceCreateMultiTimeseriesResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceCreateMultiTimeseriesResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("createMultiTimeseries_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceCreateMultiTimeseriesResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceCreateMultiTimeseriesResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - Path |
| type TSIServiceDeleteTimeseriesArgs struct { |
| SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` |
| Path []string `thrift:"path,2" db:"path" json:"path"` |
| } |
| |
| func NewTSIServiceDeleteTimeseriesArgs() *TSIServiceDeleteTimeseriesArgs { |
| return &TSIServiceDeleteTimeseriesArgs{} |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) GetPath() []string { |
| return p.Path |
| } |
| func (p *TSIServiceDeleteTimeseriesArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.Path = tSlice |
| for i := 0; i < size; i++ { |
| var _elem138 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem138 = v |
| } |
| p.Path = append(p.Path, _elem138) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("deleteTimeseries_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("path", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:path: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.Path)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.Path { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:path: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceDeleteTimeseriesArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceDeleteTimeseriesResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceDeleteTimeseriesResult() *TSIServiceDeleteTimeseriesResult { |
| return &TSIServiceDeleteTimeseriesResult{} |
| } |
| |
| var TSIServiceDeleteTimeseriesResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceDeleteTimeseriesResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceDeleteTimeseriesResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceDeleteTimeseriesResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("deleteTimeseries_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteTimeseriesResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceDeleteTimeseriesResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| // - StorageGroup |
| type TSIServiceDeleteStorageGroupsArgs struct { |
| SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` |
| StorageGroup []string `thrift:"storageGroup,2" db:"storageGroup" json:"storageGroup"` |
| } |
| |
| func NewTSIServiceDeleteStorageGroupsArgs() *TSIServiceDeleteStorageGroupsArgs { |
| return &TSIServiceDeleteStorageGroupsArgs{} |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) GetSessionId() int64 { |
| return p.SessionId |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) GetStorageGroup() []string { |
| return p.StorageGroup |
| } |
| func (p *TSIServiceDeleteStorageGroupsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| case 2: |
| if fieldTypeId == thrift.LIST { |
| if err := p.ReadField2(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) ReadField2(iprot thrift.TProtocol) error { |
| _, size, err := iprot.ReadListBegin() |
| if err != nil { |
| return thrift.PrependError("error reading list begin: ", err) |
| } |
| tSlice := make([]string, 0, size) |
| p.StorageGroup = tSlice |
| for i := 0; i < size; i++ { |
| var _elem139 string |
| if v, err := iprot.ReadString(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| _elem139 = v |
| } |
| p.StorageGroup = append(p.StorageGroup, _elem139) |
| } |
| if err := iprot.ReadListEnd(); err != nil { |
| return thrift.PrependError("error reading list end: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("deleteStorageGroups_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| if err := p.writeField2(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) writeField2(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("storageGroup", thrift.LIST, 2); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:storageGroup: ", p), err) |
| } |
| if err := oprot.WriteListBegin(thrift.STRING, len(p.StorageGroup)); err != nil { |
| return thrift.PrependError("error writing list begin: ", err) |
| } |
| for _, v := range p.StorageGroup { |
| if err := oprot.WriteString(string(v)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) |
| } |
| } |
| if err := oprot.WriteListEnd(); err != nil { |
| return thrift.PrependError("error writing list end: ", err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 2:storageGroup: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceDeleteStorageGroupsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceDeleteStorageGroupsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceDeleteStorageGroupsResult() *TSIServiceDeleteStorageGroupsResult { |
| return &TSIServiceDeleteStorageGroupsResult{} |
| } |
| |
| var TSIServiceDeleteStorageGroupsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceDeleteStorageGroupsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceDeleteStorageGroupsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceDeleteStorageGroupsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("deleteStorageGroups_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteStorageGroupsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceDeleteStorageGroupsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertRecordArgs struct { |
| Req *TSInsertRecordReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertRecordArgs() *TSIServiceInsertRecordArgs { |
| return &TSIServiceInsertRecordArgs{} |
| } |
| |
| var TSIServiceInsertRecordArgs_Req_DEFAULT *TSInsertRecordReq |
| |
| func (p *TSIServiceInsertRecordArgs) GetReq() *TSInsertRecordReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertRecordArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertRecordArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertRecordArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertRecordReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertRecord_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertRecordArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertRecordArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertRecordResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertRecordResult() *TSIServiceInsertRecordResult { |
| return &TSIServiceInsertRecordResult{} |
| } |
| |
| var TSIServiceInsertRecordResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertRecordResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertRecordResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertRecordResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertRecordResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertRecord_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertRecordResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertRecordResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertStringRecordArgs struct { |
| Req *TSInsertStringRecordReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertStringRecordArgs() *TSIServiceInsertStringRecordArgs { |
| return &TSIServiceInsertStringRecordArgs{} |
| } |
| |
| var TSIServiceInsertStringRecordArgs_Req_DEFAULT *TSInsertStringRecordReq |
| |
| func (p *TSIServiceInsertStringRecordArgs) GetReq() *TSInsertStringRecordReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertStringRecordArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertStringRecordArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertStringRecordReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertStringRecord_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertStringRecordArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertStringRecordArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertStringRecordResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertStringRecordResult() *TSIServiceInsertStringRecordResult { |
| return &TSIServiceInsertStringRecordResult{} |
| } |
| |
| var TSIServiceInsertStringRecordResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertStringRecordResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertStringRecordResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertStringRecordResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertStringRecord_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertStringRecordResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertStringRecordResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertTabletArgs struct { |
| Req *TSInsertTabletReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertTabletArgs() *TSIServiceInsertTabletArgs { |
| return &TSIServiceInsertTabletArgs{} |
| } |
| |
| var TSIServiceInsertTabletArgs_Req_DEFAULT *TSInsertTabletReq |
| |
| func (p *TSIServiceInsertTabletArgs) GetReq() *TSInsertTabletReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertTabletArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertTabletArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertTabletArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertTabletReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertTablet_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertTabletArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertTabletArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertTabletResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertTabletResult() *TSIServiceInsertTabletResult { |
| return &TSIServiceInsertTabletResult{} |
| } |
| |
| var TSIServiceInsertTabletResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertTabletResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertTabletResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertTabletResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertTabletResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertTablet_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertTabletResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertTabletResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertTabletsArgs struct { |
| Req *TSInsertTabletsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertTabletsArgs() *TSIServiceInsertTabletsArgs { |
| return &TSIServiceInsertTabletsArgs{} |
| } |
| |
| var TSIServiceInsertTabletsArgs_Req_DEFAULT *TSInsertTabletsReq |
| |
| func (p *TSIServiceInsertTabletsArgs) GetReq() *TSInsertTabletsReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertTabletsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertTabletsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertTabletsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertTabletsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertTablets_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertTabletsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertTabletsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertTabletsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertTabletsResult() *TSIServiceInsertTabletsResult { |
| return &TSIServiceInsertTabletsResult{} |
| } |
| |
| var TSIServiceInsertTabletsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertTabletsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertTabletsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertTabletsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertTabletsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertTablets_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertTabletsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertTabletsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertTabletsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertRecordsArgs struct { |
| Req *TSInsertRecordsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertRecordsArgs() *TSIServiceInsertRecordsArgs { |
| return &TSIServiceInsertRecordsArgs{} |
| } |
| |
| var TSIServiceInsertRecordsArgs_Req_DEFAULT *TSInsertRecordsReq |
| |
| func (p *TSIServiceInsertRecordsArgs) GetReq() *TSInsertRecordsReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertRecordsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertRecordsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertRecordsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertRecordsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertRecords_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertRecordsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertRecordsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertRecordsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertRecordsResult() *TSIServiceInsertRecordsResult { |
| return &TSIServiceInsertRecordsResult{} |
| } |
| |
| var TSIServiceInsertRecordsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertRecordsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertRecordsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertRecordsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertRecordsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertRecords_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertRecordsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertRecordsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertRecordsOfOneDeviceArgs struct { |
| Req *TSInsertRecordsOfOneDeviceReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertRecordsOfOneDeviceArgs() *TSIServiceInsertRecordsOfOneDeviceArgs { |
| return &TSIServiceInsertRecordsOfOneDeviceArgs{} |
| } |
| |
| var TSIServiceInsertRecordsOfOneDeviceArgs_Req_DEFAULT *TSInsertRecordsOfOneDeviceReq |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) GetReq() *TSInsertRecordsOfOneDeviceReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertRecordsOfOneDeviceArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertRecordsOfOneDeviceReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertRecordsOfOneDevice_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertRecordsOfOneDeviceArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertRecordsOfOneDeviceResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertRecordsOfOneDeviceResult() *TSIServiceInsertRecordsOfOneDeviceResult { |
| return &TSIServiceInsertRecordsOfOneDeviceResult{} |
| } |
| |
| var TSIServiceInsertRecordsOfOneDeviceResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertRecordsOfOneDeviceResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertRecordsOfOneDevice_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertRecordsOfOneDeviceResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertRecordsOfOneDeviceResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceInsertStringRecordsArgs struct { |
| Req *TSInsertStringRecordsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceInsertStringRecordsArgs() *TSIServiceInsertStringRecordsArgs { |
| return &TSIServiceInsertStringRecordsArgs{} |
| } |
| |
| var TSIServiceInsertStringRecordsArgs_Req_DEFAULT *TSInsertStringRecordsReq |
| |
| func (p *TSIServiceInsertStringRecordsArgs) GetReq() *TSInsertStringRecordsReq { |
| if !p.IsSetReq() { |
| return TSIServiceInsertStringRecordsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceInsertStringRecordsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertStringRecordsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertStringRecords_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertStringRecordsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertStringRecordsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceInsertStringRecordsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceInsertStringRecordsResult() *TSIServiceInsertStringRecordsResult { |
| return &TSIServiceInsertStringRecordsResult{} |
| } |
| |
| var TSIServiceInsertStringRecordsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceInsertStringRecordsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceInsertStringRecordsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceInsertStringRecordsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("insertStringRecords_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceInsertStringRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceInsertStringRecordsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceInsertStringRecordsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertTabletArgs struct { |
| Req *TSInsertTabletReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertTabletArgs() *TSIServiceTestInsertTabletArgs { |
| return &TSIServiceTestInsertTabletArgs{} |
| } |
| |
| var TSIServiceTestInsertTabletArgs_Req_DEFAULT *TSInsertTabletReq |
| |
| func (p *TSIServiceTestInsertTabletArgs) GetReq() *TSInsertTabletReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertTabletArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertTabletArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertTabletReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertTablet_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertTabletArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertTabletArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertTabletResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertTabletResult() *TSIServiceTestInsertTabletResult { |
| return &TSIServiceTestInsertTabletResult{} |
| } |
| |
| var TSIServiceTestInsertTabletResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertTabletResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertTabletResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertTabletResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertTablet_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertTabletResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertTabletResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertTabletsArgs struct { |
| Req *TSInsertTabletsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertTabletsArgs() *TSIServiceTestInsertTabletsArgs { |
| return &TSIServiceTestInsertTabletsArgs{} |
| } |
| |
| var TSIServiceTestInsertTabletsArgs_Req_DEFAULT *TSInsertTabletsReq |
| |
| func (p *TSIServiceTestInsertTabletsArgs) GetReq() *TSInsertTabletsReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertTabletsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertTabletsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertTabletsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertTablets_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertTabletsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertTabletsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertTabletsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertTabletsResult() *TSIServiceTestInsertTabletsResult { |
| return &TSIServiceTestInsertTabletsResult{} |
| } |
| |
| var TSIServiceTestInsertTabletsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertTabletsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertTabletsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertTabletsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertTablets_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertTabletsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertTabletsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertTabletsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertRecordArgs struct { |
| Req *TSInsertRecordReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertRecordArgs() *TSIServiceTestInsertRecordArgs { |
| return &TSIServiceTestInsertRecordArgs{} |
| } |
| |
| var TSIServiceTestInsertRecordArgs_Req_DEFAULT *TSInsertRecordReq |
| |
| func (p *TSIServiceTestInsertRecordArgs) GetReq() *TSInsertRecordReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertRecordArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertRecordArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertRecordReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertRecord_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertRecordArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertRecordArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertRecordResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertRecordResult() *TSIServiceTestInsertRecordResult { |
| return &TSIServiceTestInsertRecordResult{} |
| } |
| |
| var TSIServiceTestInsertRecordResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertRecordResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertRecordResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertRecordResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertRecord_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertRecordResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertRecordResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertStringRecordArgs struct { |
| Req *TSInsertStringRecordReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertStringRecordArgs() *TSIServiceTestInsertStringRecordArgs { |
| return &TSIServiceTestInsertStringRecordArgs{} |
| } |
| |
| var TSIServiceTestInsertStringRecordArgs_Req_DEFAULT *TSInsertStringRecordReq |
| |
| func (p *TSIServiceTestInsertStringRecordArgs) GetReq() *TSInsertStringRecordReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertStringRecordArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertStringRecordArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertStringRecordReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertStringRecord_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertStringRecordArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertStringRecordResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertStringRecordResult() *TSIServiceTestInsertStringRecordResult { |
| return &TSIServiceTestInsertStringRecordResult{} |
| } |
| |
| var TSIServiceTestInsertStringRecordResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertStringRecordResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertStringRecordResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertStringRecordResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertStringRecord_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertStringRecordResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertRecordsArgs struct { |
| Req *TSInsertRecordsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertRecordsArgs() *TSIServiceTestInsertRecordsArgs { |
| return &TSIServiceTestInsertRecordsArgs{} |
| } |
| |
| var TSIServiceTestInsertRecordsArgs_Req_DEFAULT *TSInsertRecordsReq |
| |
| func (p *TSIServiceTestInsertRecordsArgs) GetReq() *TSInsertRecordsReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertRecordsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertRecordsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertRecordsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertRecords_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertRecordsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertRecordsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertRecordsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertRecordsResult() *TSIServiceTestInsertRecordsResult { |
| return &TSIServiceTestInsertRecordsResult{} |
| } |
| |
| var TSIServiceTestInsertRecordsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertRecordsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertRecordsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertRecordsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertRecords_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertRecordsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertRecordsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertRecordsOfOneDeviceArgs struct { |
| Req *TSInsertRecordsOfOneDeviceReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertRecordsOfOneDeviceArgs() *TSIServiceTestInsertRecordsOfOneDeviceArgs { |
| return &TSIServiceTestInsertRecordsOfOneDeviceArgs{} |
| } |
| |
| var TSIServiceTestInsertRecordsOfOneDeviceArgs_Req_DEFAULT *TSInsertRecordsOfOneDeviceReq |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) GetReq() *TSInsertRecordsOfOneDeviceReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertRecordsOfOneDeviceArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertRecordsOfOneDeviceReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertRecordsOfOneDevice_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertRecordsOfOneDeviceArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertRecordsOfOneDeviceResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertRecordsOfOneDeviceResult() *TSIServiceTestInsertRecordsOfOneDeviceResult { |
| return &TSIServiceTestInsertRecordsOfOneDeviceResult{} |
| } |
| |
| var TSIServiceTestInsertRecordsOfOneDeviceResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertRecordsOfOneDeviceResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertRecordsOfOneDevice_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertRecordsOfOneDeviceResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertRecordsOfOneDeviceResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceTestInsertStringRecordsArgs struct { |
| Req *TSInsertStringRecordsReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceTestInsertStringRecordsArgs() *TSIServiceTestInsertStringRecordsArgs { |
| return &TSIServiceTestInsertStringRecordsArgs{} |
| } |
| |
| var TSIServiceTestInsertStringRecordsArgs_Req_DEFAULT *TSInsertStringRecordsReq |
| |
| func (p *TSIServiceTestInsertStringRecordsArgs) GetReq() *TSInsertStringRecordsReq { |
| if !p.IsSetReq() { |
| return TSIServiceTestInsertStringRecordsArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceTestInsertStringRecordsArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSInsertStringRecordsReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertStringRecords_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertStringRecordsArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceTestInsertStringRecordsResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceTestInsertStringRecordsResult() *TSIServiceTestInsertStringRecordsResult { |
| return &TSIServiceTestInsertStringRecordsResult{} |
| } |
| |
| var TSIServiceTestInsertStringRecordsResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceTestInsertStringRecordsResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceTestInsertStringRecordsResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceTestInsertStringRecordsResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("testInsertStringRecords_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceTestInsertStringRecordsResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceTestInsertStringRecordsResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceDeleteDataArgs struct { |
| Req *TSDeleteDataReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceDeleteDataArgs() *TSIServiceDeleteDataArgs { |
| return &TSIServiceDeleteDataArgs{} |
| } |
| |
| var TSIServiceDeleteDataArgs_Req_DEFAULT *TSDeleteDataReq |
| |
| func (p *TSIServiceDeleteDataArgs) GetReq() *TSDeleteDataReq { |
| if !p.IsSetReq() { |
| return TSIServiceDeleteDataArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceDeleteDataArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceDeleteDataArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteDataArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSDeleteDataReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteDataArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("deleteData_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteDataArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteDataArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceDeleteDataArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceDeleteDataResult struct { |
| Success *TSStatus `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceDeleteDataResult() *TSIServiceDeleteDataResult { |
| return &TSIServiceDeleteDataResult{} |
| } |
| |
| var TSIServiceDeleteDataResult_Success_DEFAULT *TSStatus |
| |
| func (p *TSIServiceDeleteDataResult) GetSuccess() *TSStatus { |
| if !p.IsSetSuccess() { |
| return TSIServiceDeleteDataResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceDeleteDataResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceDeleteDataResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteDataResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSStatus{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteDataResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("deleteData_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceDeleteDataResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceDeleteDataResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceDeleteDataResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Req |
| type TSIServiceExecuteRawDataQueryArgs struct { |
| Req *TSRawDataQueryReq `thrift:"req,1" db:"req" json:"req"` |
| } |
| |
| func NewTSIServiceExecuteRawDataQueryArgs() *TSIServiceExecuteRawDataQueryArgs { |
| return &TSIServiceExecuteRawDataQueryArgs{} |
| } |
| |
| var TSIServiceExecuteRawDataQueryArgs_Req_DEFAULT *TSRawDataQueryReq |
| |
| func (p *TSIServiceExecuteRawDataQueryArgs) GetReq() *TSRawDataQueryReq { |
| if !p.IsSetReq() { |
| return TSIServiceExecuteRawDataQueryArgs_Req_DEFAULT |
| } |
| return p.Req |
| } |
| func (p *TSIServiceExecuteRawDataQueryArgs) IsSetReq() bool { |
| return p.Req != nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryArgs) ReadField1(iprot thrift.TProtocol) error { |
| p.Req = &TSRawDataQueryReq{} |
| if err := p.Req.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeRawDataQuery_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) |
| } |
| if err := p.Req.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteRawDataQueryArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceExecuteRawDataQueryResult struct { |
| Success *TSExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceExecuteRawDataQueryResult() *TSIServiceExecuteRawDataQueryResult { |
| return &TSIServiceExecuteRawDataQueryResult{} |
| } |
| |
| var TSIServiceExecuteRawDataQueryResult_Success_DEFAULT *TSExecuteStatementResp |
| |
| func (p *TSIServiceExecuteRawDataQueryResult) GetSuccess() *TSExecuteStatementResp { |
| if !p.IsSetSuccess() { |
| return TSIServiceExecuteRawDataQueryResult_Success_DEFAULT |
| } |
| return p.Success |
| } |
| func (p *TSIServiceExecuteRawDataQueryResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.STRUCT { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryResult) ReadField0(iprot thrift.TProtocol) error { |
| p.Success = &TSExecuteStatementResp{} |
| if err := p.Success.Read(iprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("executeRawDataQuery_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := p.Success.Write(oprot); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceExecuteRawDataQueryResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceExecuteRawDataQueryResult(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - SessionId |
| type TSIServiceRequestStatementIdArgs struct { |
| SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` |
| } |
| |
| func NewTSIServiceRequestStatementIdArgs() *TSIServiceRequestStatementIdArgs { |
| return &TSIServiceRequestStatementIdArgs{} |
| } |
| |
| func (p *TSIServiceRequestStatementIdArgs) GetSessionId() int64 { |
| return p.SessionId |
| } |
| func (p *TSIServiceRequestStatementIdArgs) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 1: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField1(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdArgs) ReadField1(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 1: ", err) |
| } else { |
| p.SessionId = v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdArgs) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("requestStatementId_args"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField1(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdArgs) writeField1(oprot thrift.TProtocol) (err error) { |
| if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(p.SessionId)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) |
| } |
| return err |
| } |
| |
| func (p *TSIServiceRequestStatementIdArgs) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceRequestStatementIdArgs(%+v)", *p) |
| } |
| |
| // Attributes: |
| // - Success |
| type TSIServiceRequestStatementIdResult struct { |
| Success *int64 `thrift:"success,0" db:"success" json:"success,omitempty"` |
| } |
| |
| func NewTSIServiceRequestStatementIdResult() *TSIServiceRequestStatementIdResult { |
| return &TSIServiceRequestStatementIdResult{} |
| } |
| |
| var TSIServiceRequestStatementIdResult_Success_DEFAULT int64 |
| |
| func (p *TSIServiceRequestStatementIdResult) GetSuccess() int64 { |
| if !p.IsSetSuccess() { |
| return TSIServiceRequestStatementIdResult_Success_DEFAULT |
| } |
| return *p.Success |
| } |
| func (p *TSIServiceRequestStatementIdResult) IsSetSuccess() bool { |
| return p.Success != nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdResult) Read(iprot thrift.TProtocol) error { |
| if _, err := iprot.ReadStructBegin(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| } |
| |
| for { |
| _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| if err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| } |
| if fieldTypeId == thrift.STOP { |
| break |
| } |
| switch fieldId { |
| case 0: |
| if fieldTypeId == thrift.I64 { |
| if err := p.ReadField0(iprot); err != nil { |
| return err |
| } |
| } else { |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| default: |
| if err := iprot.Skip(fieldTypeId); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadFieldEnd(); err != nil { |
| return err |
| } |
| } |
| if err := iprot.ReadStructEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdResult) ReadField0(iprot thrift.TProtocol) error { |
| if v, err := iprot.ReadI64(); err != nil { |
| return thrift.PrependError("error reading field 0: ", err) |
| } else { |
| p.Success = &v |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdResult) Write(oprot thrift.TProtocol) error { |
| if err := oprot.WriteStructBegin("requestStatementId_result"); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| } |
| if p != nil { |
| if err := p.writeField0(oprot); err != nil { |
| return err |
| } |
| } |
| if err := oprot.WriteFieldStop(); err != nil { |
| return thrift.PrependError("write field stop error: ", err) |
| } |
| if err := oprot.WriteStructEnd(); err != nil { |
| return thrift.PrependError("write struct stop error: ", err) |
| } |
| return nil |
| } |
| |
| func (p *TSIServiceRequestStatementIdResult) writeField0(oprot thrift.TProtocol) (err error) { |
| if p.IsSetSuccess() { |
| if err := oprot.WriteFieldBegin("success", thrift.I64, 0); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) |
| } |
| if err := oprot.WriteI64(int64(*p.Success)); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) |
| } |
| if err := oprot.WriteFieldEnd(); err != nil { |
| return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) |
| } |
| } |
| return err |
| } |
| |
| func (p *TSIServiceRequestStatementIdResult) String() string { |
| if p == nil { |
| return "<nil>" |
| } |
| return fmt.Sprintf("TSIServiceRequestStatementIdResult(%+v)", *p) |
| } |